diff options
author | Yunsup Lee <yunsup@cs.berkeley.edu> | 2014-04-14 22:46:46 -0700 |
---|---|---|
committer | Yunsup Lee <yunsup@cs.berkeley.edu> | 2014-04-14 22:46:46 -0700 |
commit | f4203e9e56f882af52960d15b98ab881712f776d (patch) | |
tree | ff67ecb4da6f1d3decb5faad273aea6bbf6d00ee /benchmarks/common/syscalls.c | |
parent | c31d7c5eb4109fdcce58d27b132e20596ece2d07 (diff) | |
download | riscv-tests-eos20-bringup.zip riscv-tests-eos20-bringup.tar.gz riscv-tests-eos20-bringup.tar.bz2 |
add mm benchmark for eos20eos20-bringup
Diffstat (limited to 'benchmarks/common/syscalls.c')
-rw-r--r-- | benchmarks/common/syscalls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c index f95dde4..a882462 100644 --- a/benchmarks/common/syscalls.c +++ b/benchmarks/common/syscalls.c @@ -6,7 +6,7 @@ void exit(int code) { volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = 1; + magic_mem[0] = 93; magic_mem[1] = code; __sync_synchronize(); mtpcr(PCR_TOHOST, (long)magic_mem); @@ -16,7 +16,7 @@ void exit(int code) void printstr(const char* s) { volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = 4; + magic_mem[0] = 64; magic_mem[1] = 1; magic_mem[2] = (unsigned long)s; magic_mem[3] = strlen(s); @@ -28,8 +28,8 @@ void printstr(const char* s) int putchar(int ch) { #define buffered_putch_bufsize 64 - static char buf[buffered_putch_bufsize]; - static int buflen = 0; + static __thread char buf[buffered_putch_bufsize]; + static __thread int buflen = 0; if(ch != -1) buf[buflen++] = ch; @@ -37,7 +37,7 @@ int putchar(int ch) if(ch == -1 || buflen == buffered_putch_bufsize) { volatile uint64_t magic_mem[8] = {0}; - magic_mem[0] = 4; + magic_mem[0] = 64; magic_mem[1] = 1; magic_mem[2] = (long)buf; magic_mem[3] = buflen; |