From dda7db273d9b897ef39a93d8ee69c8f202b5540b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 30 Oct 2017 11:22:54 +0100 Subject: Add missing "volatile" to "asm" statements --- dhrystone/stdlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dhrystone') 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; } -- cgit