qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macr


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros
Date: Tue, 28 Jul 2009 19:04:56 -0300

When we start porting handlers to use the Monitor's dictionary
to pass argments, we will turn function parameters into automatic
variables.

This will make the build brake when the 32 bits versions of
GET_TLONG and GET_TPHYSADDR are used, because the 'h' argument
will not be used.

The best solution I could think for this problem was changing
both macros to reassign the 'h' parameter when compiled for
32 bits.

I'm open for better solutions, though.

Signed-off-by: Luiz Capitulino <address@hidden>
---
 monitor.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/monitor.c b/monitor.c
index 802edb7..b46df28 100644
--- a/monitor.c
+++ b/monitor.c
@@ -778,7 +778,11 @@ static void memory_dump(Monitor *mon, int count, int 
format, int wsize,
 #if TARGET_LONG_BITS == 64
 #define GET_TLONG(h, l) (((uint64_t)(h) << 32) | (l))
 #else
-#define GET_TLONG(h, l) (l)
+static inline uint32_t GET_TLONG(uint32_t h, uint32_t l)
+{
+    h = h; /* avoid build error */
+    return l;
+}
 #endif
 
 static void do_memory_dump(Monitor *mon, int count, int format, int size,
@@ -791,7 +795,11 @@ static void do_memory_dump(Monitor *mon, int count, int 
format, int size,
 #if TARGET_PHYS_ADDR_BITS > 32
 #define GET_TPHYSADDR(h, l) (((uint64_t)(h) << 32) | (l))
 #else
-#define GET_TPHYSADDR(h, l) (l)
+static inline uint32_t GET_TPHYSADDR(uint32_t h, uint32_t l)
+{
+    h = h; /* avoid build error */
+    return l;
+}
 #endif
 
 static void do_physical_memory_dump(Monitor *mon, int count, int format,
-- 
1.6.4.rc3.12.gdf73a





reply via email to

[Prev in Thread] Current Thread [Next in Thread]