]> git.proxmox.com Git - mirror_qemu.git/commitdiff
w64: Fix size of ram_addr_t
authorStefan Weil <sw@weilnetz.de>
Fri, 2 Mar 2012 22:30:02 +0000 (23:30 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 3 Mar 2012 18:10:16 +0000 (18:10 +0000)
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 <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpu-common.h

index a40c57dc1f9e67daa4819f41fdb06d60629cb267..dca5175652ff222f15dd82037f8415f2e0d5b77e 100644 (file)
@@ -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 */