aboutsummaryrefslogtreecommitdiff
path: root/cpu-common.h
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-03-02 23:30:02 +0100
committerBlue Swirl <blauwirbel@gmail.com>2012-03-03 18:10:16 +0000
commit53576999a6905d76a59ce47006a2a0c0b03f942e (patch)
tree6863c376eb29c47e0dba99b6a20b9f4fbe65f331 /cpu-common.h
parent5a30d3f19d9c6d135bf7a395a24dc455698d5cf9 (diff)
w64: Fix size of ram_addr_t
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>
Diffstat (limited to 'cpu-common.h')
-rw-r--r--cpu-common.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpu-common.h b/cpu-common.h
index a40c57dc1f..dca5175652 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 */