qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host)
@ 2009-09-06 17:55 Stefan Weil
  2009-09-07  8:26 ` Arnaud Patard
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2009-09-06 17:55 UTC (permalink / raw)
  To: qemu-devel

Compilation for MIPS host (not part of official QEMU)
checks __mips_isa_rev which is not always defined.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 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;
     static uint32_t cyc_per_count = 0;
 
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host)
  2009-09-06 17:55 [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host) Stefan Weil
@ 2009-09-07  8:26 ` Arnaud Patard
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud Patard @ 2009-09-07  8:26 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel

Stefan Weil <weil@mail.berlios.de> 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 <weil@mail.berlios.de>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-07  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-06 17:55 [Qemu-devel] [PATCH] Fix conditional compilation (MIPS host) Stefan Weil
2009-09-07  8:26 ` Arnaud Patard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).