qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/6] w64: Fix size of ram_addr_t


From: Stefan Weil
Subject: [Qemu-devel] [PATCH 1/6] w64: Fix size of ram_addr_t
Date: Fri, 2 Mar 2012 23:30:02 +0100

ram_addr_t must be large enough to address any address of the host.

For hosts with sizeof(unsigned long) == sizeof(void *), this patch
changes nothing. All currently supported hosts fall into this category.

For w64 hosts, sizeof(unsigned long) is 4 while sizeof(void *) is 8,
so the use of uintptr_t is needed.

Signed-off-by: Stefan Weil <address@hidden>
---
 cpu-common.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpu-common.h b/cpu-common.h
index a40c57d..dca5175 100644
--- a/cpu-common.h
+++ b/cpu-common.h
@@ -28,9 +28,9 @@ typedef uint64_t ram_addr_t;
 #  define RAM_ADDR_MAX UINT64_MAX
 #  define RAM_ADDR_FMT "%" PRIx64
 #else
-typedef unsigned long ram_addr_t;
-#  define RAM_ADDR_MAX ULONG_MAX
-#  define RAM_ADDR_FMT "%lx"
+typedef uintptr_t ram_addr_t;
+#  define RAM_ADDR_MAX UINTPTR_MAX
+#  define RAM_ADDR_FMT "%" PRIxPTR
 #endif
 
 /* memory API */
-- 
1.7.9




reply via email to

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