Fix conditional compilation (MIPS host)
PATCH 1/1 Fix conditional compilation (MIPS host)
Compilation for MIPS host (not part of official QEMU) checks __mips_isa_rev which is not always defined.
--- cpu-all.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
cpu-all.h +1 -1
@@ -1021,7 +1021,7 @@ static inline int64_t cpu_get_real_ticks (void)static inline int64_t cpu_get_real_ticks (void ) { -#if __mips_isa_rev >=2 +#if defined(__mips_isa_rev) && __mips_isa_rev >=2 uint32_t count;static uint32_t cyc_per_count =0 ;
Signature · 1 line
1.5.6.5
Stefan Weil <[email protected]> writes:
Hi,
Quoted 13 lines
Compilation for MIPS host (not part of official QEMU) checks
__mips_isa_revwhich is not always defined.Signed-off-by Stefan Weil <[email protected]>--- cpu-all.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)cpu-all.h +0
-0
cpu-all.h static inline int64_t cpu_get_real_ticks (void) · line 1025
Quoted 6 lines
cpu-all.h +1
-1@@ -1021,7 +1021,7 @@ static inline int64_t cpu_get_real_ticks (void)static inline int64_t cpu_get_real_ticks (void ) { -#if __mips_isa_rev >=2 +#if defined(__mips_isa_rev) && __mips_isa_rev >=2 uint32_t count;
The other fix would have to check on __mips or _MIPS_ISA (don't know how gcc-centric are theses macros though.). Also, on linux with a kernel >= 2.6.25, one can use "rdhwr <reg>,$2" or "rdhwr <reg>,$3"
without too many troubles as the kernel traps and emulates them. Would be a shame imho to fallback to incrementing a counter when one can read the mips counter.
fwiw, I had this patch :
http://git.rtp-net.org/?p=qemu.git;a=commitdiff;h=65eb2fb99e4b6a81541635171b9576ca972bebf3
Unfortunately, as I've used it only on loongson, I'm not sure if it's safe on other boxes (this is why I didn't send this patch for merge)
Arnaud