Commit ab6d960ffa1271db6866fc2b27e97e99a73598d2
1 parent
fbf9eeb3
added target_phys_addr_t
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@756 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
15 additions
and
0 deletions
cpu-defs.h
| @@ -29,8 +29,13 @@ | @@ -29,8 +29,13 @@ | ||
| 29 | #error TARGET_LONG_BITS must be defined before including this header | 29 | #error TARGET_LONG_BITS must be defined before including this header |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | +#ifndef TARGET_PHYS_ADDR_BITS | ||
| 33 | +#define TARGET_PHYS_ADDR_BITS TARGET_LONG_BITS | ||
| 34 | +#endif | ||
| 35 | + | ||
| 32 | #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) | 36 | #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) |
| 33 | 37 | ||
| 38 | +/* target_ulong is the type of a virtual address */ | ||
| 34 | #if TARGET_LONG_SIZE == 4 | 39 | #if TARGET_LONG_SIZE == 4 |
| 35 | typedef int32_t target_long; | 40 | typedef int32_t target_long; |
| 36 | typedef uint32_t target_ulong; | 41 | typedef uint32_t target_ulong; |
| @@ -41,6 +46,16 @@ typedef uint64_t target_ulong; | @@ -41,6 +46,16 @@ typedef uint64_t target_ulong; | ||
| 41 | #error TARGET_LONG_SIZE undefined | 46 | #error TARGET_LONG_SIZE undefined |
| 42 | #endif | 47 | #endif |
| 43 | 48 | ||
| 49 | +/* target_phys_addr_t is the type of a physical address (its size can | ||
| 50 | + be different from 'target_ulong') */ | ||
| 51 | +#if TARGET_PHYS_ADDR_BITS == 32 | ||
| 52 | +typedef uint32_t target_phys_addr_t; | ||
| 53 | +#elif TARGET_PHYS_ADDR_BITS == 64 | ||
| 54 | +typedef uint64_t target_phys_addr_t; | ||
| 55 | +#else | ||
| 56 | +#error TARGET_PHYS_ADDR_BITS undefined | ||
| 57 | +#endif | ||
| 58 | + | ||
| 44 | #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) | 59 | #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) |
| 45 | #define HOST_LONG_BITS 64 | 60 | #define HOST_LONG_BITS 64 |
| 46 | #else | 61 | #else |