[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host)
From: |
Rtp |
Subject: |
Re: [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host) |
Date: |
Mon, 07 Sep 2009 10:26:37 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Stefan Weil <address@hidden> writes:
Hi,
> Compilation for MIPS host (not part of official QEMU)
> checks __mips_isa_rev which is not always defined.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> cpu-all.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/cpu-all.h b/cpu-all.h
> index 1a6a812..ebe8bfb 100644
> --- a/cpu-all.h
> +++ b/cpu-all.h
> @@ -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