summaryrefslogtreecommitdiff
path: root/cpu-defs.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-25 21:25:15 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-25 21:25:15 +0000
commitab6d960ffa1271db6866fc2b27e97e99a73598d2 (patch)
tree5fa12c890a821493a81fb4e2aeebaacdd2681a90 /cpu-defs.h
parentfbf9eeb34dfd9f9eb805410d90ffbb9ca2c0fbd1 (diff)
downloadqemu-ab6d960ffa1271db6866fc2b27e97e99a73598d2.tar.gz
added target_phys_addr_t
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@756 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-defs.h')
-rw-r--r--cpu-defs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpu-defs.h b/cpu-defs.h
index bbdb390099..2e643e6e2a 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -29,8 +29,13 @@
#error TARGET_LONG_BITS must be defined before including this header
#endif
+#ifndef TARGET_PHYS_ADDR_BITS
+#define TARGET_PHYS_ADDR_BITS TARGET_LONG_BITS
+#endif
+
#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)
+/* target_ulong is the type of a virtual address */
#if TARGET_LONG_SIZE == 4
typedef int32_t target_long;
typedef uint32_t target_ulong;
@@ -41,6 +46,16 @@ typedef uint64_t target_ulong;
#error TARGET_LONG_SIZE undefined
#endif
+/* target_phys_addr_t is the type of a physical address (its size can
+ be different from 'target_ulong') */
+#if TARGET_PHYS_ADDR_BITS == 32
+typedef uint32_t target_phys_addr_t;
+#elif TARGET_PHYS_ADDR_BITS == 64
+typedef uint64_t target_phys_addr_t;
+#else
+#error TARGET_PHYS_ADDR_BITS undefined
+#endif
+
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define HOST_LONG_BITS 64
#else