[Top][All Lists]
[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
- [Qemu-devel] Re: [PATCH 01/25] Introduce QEMU dictionary data type, (continued)
[Qemu-devel] [PATCH 02/25] net: Fix do_set_link() return type, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 03/25] Add wrappers to functions used by the Monitor, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 04/25] monitor: Document missing supported argument types, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 05/25] monitor: New format for handlers argument types, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 06/25] monitor: Setup a dictionary with handler arguments, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 07/25] monitor: Export qemu-dict.h header, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros,
Luiz Capitulino <=
[Qemu-devel] [PATCH 09/25] monitor: Port handler_0 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 10/25] monitor: Port handler_1 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 11/25] monitor: Port handler_2 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 13/25] monitor: Port handler_4 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 12/25] monitor: Port handler_3 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 14/25] monitor: Port handler_5 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 15/25] monitor: Port handler_6 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 16/25] monitor: Port handler_7 to use the dictionary, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 17/25] monitor: Drop handler_8 and handler_9 handling, Luiz Capitulino, 2009/07/28
[Qemu-devel] [PATCH 18/25] monitor: Port handler_10 to use the dictionary, Luiz Capitulino, 2009/07/28