Firmwares/benchmarks/dhrystone/dhry_stubs.c

26 lines
462 B
C
Raw Normal View History

2020-06-18 12:15:52 +02:00
#include "platform.h"
#ifndef ITERATIONS
#define ITERATIONS 20000
#endif
2020-06-18 12:15:52 +02:00
/* The functions in this file are only meant to support Dhrystone on an
* embedded RV32 system and are obviously incorrect in general. */
long time(void)
{
2023-08-20 15:00:51 +02:00
return get_timer_value();
2020-06-18 12:15:52 +02:00
}
// set the number of dhrystone iterations
void __wrap_scanf(const char* fmt, int* n)
{
*n = ITERATIONS;
2020-06-18 12:15:52 +02:00
}
2023-08-20 15:00:51 +02:00
extern volatile uint32_t tohost;
2020-06-18 12:15:52 +02:00
void exit(int n){
2020-06-18 12:15:52 +02:00
tohost = 0x1;
for (;;);
}