diff options
Diffstat (limited to 'bench')
-rw-r--r-- | bench/benchmarks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bench/benchmarks.c b/bench/benchmarks.c index ac24c22..49ff008 100644 --- a/bench/benchmarks.c +++ b/bench/benchmarks.c @@ -1,19 +1,24 @@ #include <time.h> #include <sys/time.h> -#include <asm/unistd.h> #include <sys/stat.h> #include <stdio.h> #include "../x86info.h" #include "bench.h" +#ifdef __linux__ +#include <asm/unistd.h> +#endif + void show_benchmarks(void) { - int ret, tmp=0; + int tmp = 0; if (show_bench != 1) return; - TIME(asm volatile("int $0x80" :"=a" (ret) :"0" (__NR_getppid)), "int 0x80"); +#ifdef __linux__ + TIME(asm volatile("int $0x80" :"=a" (tmp) :"0" (__NR_getppid)), "int 0x80"); +#endif TIME(asm volatile("cpuid": : :"ax", "dx", "cx", "bx"), "cpuid"); TIME(asm volatile("addl $1,0(%esp)"), "addl"); |