diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-10-30 11:22:54 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-10-30 11:22:54 +0100 |
commit | dda7db273d9b897ef39a93d8ee69c8f202b5540b (patch) | |
tree | c00198491d39e47929c6292c742699816b01f206 /dhrystone | |
parent | 31588b871e0258f28a6daa5a34a6ad53ab11f267 (diff) | |
download | picorv32-dda7db273d9b897ef39a93d8ee69c8f202b5540b.tar.gz picorv32-dda7db273d9b897ef39a93d8ee69c8f202b5540b.zip |
Add missing "volatile" to "asm" statements
Diffstat (limited to 'dhrystone')
-rw-r--r-- | dhrystone/stdlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dhrystone/stdlib.c b/dhrystone/stdlib.c index 55150a7..f88023b 100644 --- a/dhrystone/stdlib.c +++ b/dhrystone/stdlib.c @@ -26,7 +26,7 @@ int heap_memory_used = 0; long time() { int cycles; - asm("rdcycle %0" : "=r"(cycles)); + asm volatile ("rdcycle %0" : "=r"(cycles)); // printf("[time() -> %d]", cycles); return cycles; } @@ -34,7 +34,7 @@ long time() long insn() { int insns; - asm("rdinstret %0" : "=r"(insns)); + asm volatile ("rdinstret %0" : "=r"(insns)); // printf("[insn() -> %d]", insns); return insns; } @@ -46,7 +46,7 @@ char *malloc(int size) // printf("[malloc(%d) -> %d (%d..%d)]", size, (int)p, heap_memory_used, heap_memory_used + size); heap_memory_used += size; if (heap_memory_used > 1024) - asm("ebreak"); + asm volatile ("ebreak"); return p; } |