diff --git a/sys/libkern/mcount.c b/sys/libkern/mcount.c index d967fe8bb254..e26f6fab3428 100644 --- a/sys/libkern/mcount.c +++ b/sys/libkern/mcount.c @@ -268,18 +268,23 @@ mexitcount(selfpc) } } +#ifndef __GNUCLIKE_ASM +#error "This file uses null asms to prevent timing loops being optimized away." +#endif + void empty_loop() { int i; for (i = 0; i < CALIB_SCALE; i++) - ; + __asm __volatile(""); } void nullfunc() { + __asm __volatile(""); } void