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,6 +23,22 @@ | ||
| 23 | #include "config.h" | 23 | #include "config.h" |
| 24 | #include <setjmp.h> | 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 | #define EXCP_INTERRUPT 256 /* async interruption */ | 42 | #define EXCP_INTERRUPT 256 /* async interruption */ |
| 27 | #define EXCP_HLT 257 /* hlt instruction reached */ | 43 | #define EXCP_HLT 257 /* hlt instruction reached */ |
| 28 | #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */ | 44 | #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */ |
exec-all.h
| @@ -28,11 +28,6 @@ | @@ -28,11 +28,6 @@ | ||
| 28 | #define tostring(s) #s | 28 | #define tostring(s) #s |
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | -#ifndef THUNK_H | ||
| 32 | -/* horrible */ | ||
| 33 | -typedef uint32_t target_ulong; | ||
| 34 | -#endif | ||
| 35 | - | ||
| 36 | #if GCC_MAJOR < 3 | 31 | #if GCC_MAJOR < 3 |
| 37 | #define __builtin_expect(x, n) (x) | 32 | #define __builtin_expect(x, n) (x) |
| 38 | #endif | 33 | #endif |
thunk.h
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | #define THUNK_H | 21 | #define THUNK_H |
| 22 | 22 | ||
| 23 | #include <inttypes.h> | 23 | #include <inttypes.h> |
| 24 | -#include "config.h" | 24 | +#include "cpu.h" |
| 25 | 25 | ||
| 26 | #include "bswap.h" | 26 | #include "bswap.h" |
| 27 | 27 | ||
| @@ -29,11 +29,6 @@ | @@ -29,11 +29,6 @@ | ||
| 29 | #define BSWAP_NEEDED | 29 | #define BSWAP_NEEDED |
| 30 | #endif | 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 | #ifdef BSWAP_NEEDED | 32 | #ifdef BSWAP_NEEDED |
| 38 | 33 | ||
| 39 | static inline uint16_t tswap16(uint16_t s) | 34 | static inline uint16_t tswap16(uint16_t s) |
| @@ -105,16 +100,6 @@ static inline void tswap64s(uint64_t *s) | @@ -105,16 +100,6 @@ static inline void tswap64s(uint64_t *s) | ||
| 105 | #define tswapls(s) tswap64s((uint64_t *)(s)) | 100 | #define tswapls(s) tswap64s((uint64_t *)(s)) |
| 106 | #endif | 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 | /* types enums definitions */ | 103 | /* types enums definitions */ |
| 119 | 104 | ||
| 120 | typedef enum argtype { | 105 | typedef enum argtype { |