uses write_hex() in exit instead of tohost=0x1

This commit is contained in:
2025-04-15 12:32:09 +02:00
parent 9909769c0a
commit 8b3dc54e5c
2 changed files with 16 additions and 15 deletions

View File

@ -1,4 +1,5 @@
#include "platform.h"
#include <unistd.h>
#ifndef ITERATIONS
#define ITERATIONS 20000
#endif
@ -6,20 +7,16 @@
/* 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)
{
return get_timer_value();
}
long time(void) { return get_timer_value(); }
// set the number of dhrystone iterations
void __wrap_scanf(const char* fmt, int* n)
{
*n = ITERATIONS;
}
void __wrap_scanf(const char *fmt, int *n) { *n = ITERATIONS; }
extern volatile uint32_t tohost;
// extern volatile uint64_t tohost;
void exit(int n){
tohost = 0x1;
for (;;);
void exit(int n) {
// tohost = 0x1;
write_hex(STDERR_FILENO, 1);
for (;;)
;
}