Commit 35b66fc4f9dd2c4c3fb8e26c5c1480965b81bbd4
1 parent
13eb76e0
correct target_ulong definition
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@582 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
17 additions
and
21 deletions
cpu-defs.h
| ... | ... | @@ -23,6 +23,22 @@ |
| 23 | 23 | #include "config.h" |
| 24 | 24 | #include <setjmp.h> |
| 25 | 25 | |
| 26 | +#ifndef TARGET_LONG_BITS | |
| 27 | +#error TARGET_LONG_BITS must be defined before including this header | |
| 28 | +#endif | |
| 29 | + | |
| 30 | +#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) | |
| 31 | + | |
| 32 | +#if TARGET_LONG_SIZE == 4 | |
| 33 | +typedef int32_t target_long; | |
| 34 | +typedef uint32_t target_ulong; | |
| 35 | +#elif TARGET_LONG_SIZE == 8 | |
| 36 | +typedef int64_t target_long; | |
| 37 | +typedef uint64_t target_ulong; | |
| 38 | +#else | |
| 39 | +#error TARGET_LONG_SIZE undefined | |
| 40 | +#endif | |
| 41 | + | |
| 26 | 42 | #define EXCP_INTERRUPT 256 /* async interruption */ |
| 27 | 43 | #define EXCP_HLT 257 /* hlt instruction reached */ |
| 28 | 44 | #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */ | ... | ... |
exec-all.h
thunk.h
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | #define THUNK_H |
| 22 | 22 | |
| 23 | 23 | #include <inttypes.h> |
| 24 | -#include "config.h" | |
| 24 | +#include "cpu.h" | |
| 25 | 25 | |
| 26 | 26 | #include "bswap.h" |
| 27 | 27 | |
| ... | ... | @@ -29,11 +29,6 @@ |
| 29 | 29 | #define BSWAP_NEEDED |
| 30 | 30 | #endif |
| 31 | 31 | |
| 32 | -/* XXX: autoconf */ | |
| 33 | -#define TARGET_LONG_BITS 32 | |
| 34 | - | |
| 35 | -#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) | |
| 36 | - | |
| 37 | 32 | #ifdef BSWAP_NEEDED |
| 38 | 33 | |
| 39 | 34 | static inline uint16_t tswap16(uint16_t s) |
| ... | ... | @@ -105,16 +100,6 @@ static inline void tswap64s(uint64_t *s) |
| 105 | 100 | #define tswapls(s) tswap64s((uint64_t *)(s)) |
| 106 | 101 | #endif |
| 107 | 102 | |
| 108 | -#if TARGET_LONG_SIZE == 4 | |
| 109 | -typedef int32_t target_long; | |
| 110 | -typedef uint32_t target_ulong; | |
| 111 | -#elif TARGET_LONG_SIZE == 8 | |
| 112 | -typedef int64_t target_long; | |
| 113 | -typedef uint64_t target_ulong; | |
| 114 | -#else | |
| 115 | -#error TARGET_LONG_SIZE undefined | |
| 116 | -#endif | |
| 117 | - | |
| 118 | 103 | /* types enums definitions */ |
| 119 | 104 | |
| 120 | 105 | typedef enum argtype { | ... | ... |