Skip to content

Commit

Permalink
correct target_ulong definition
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@582 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
bellard committed Jan 24, 2004
1 parent 13eb76e commit 35b66fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
16 changes: 16 additions & 0 deletions cpu-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@
#include "config.h"
#include <setjmp.h>

#ifndef TARGET_LONG_BITS
#error TARGET_LONG_BITS must be defined before including this header
#endif

#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)

#if TARGET_LONG_SIZE == 4
typedef int32_t target_long;
typedef uint32_t target_ulong;
#elif TARGET_LONG_SIZE == 8
typedef int64_t target_long;
typedef uint64_t target_ulong;
#else
#error TARGET_LONG_SIZE undefined
#endif

#define EXCP_INTERRUPT 256 /* async interruption */
#define EXCP_HLT 257 /* hlt instruction reached */
#define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */
Expand Down
5 changes: 0 additions & 5 deletions exec-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
#define tostring(s) #s
#endif

#ifndef THUNK_H
/* horrible */
typedef uint32_t target_ulong;
#endif

#if GCC_MAJOR < 3
#define __builtin_expect(x, n) (x)
#endif
Expand Down
17 changes: 1 addition & 16 deletions thunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,14 @@
#define THUNK_H

#include <inttypes.h>
#include "config.h"
#include "cpu.h"

#include "bswap.h"

#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
#define BSWAP_NEEDED
#endif

/* XXX: autoconf */
#define TARGET_LONG_BITS 32

#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)

#ifdef BSWAP_NEEDED

static inline uint16_t tswap16(uint16_t s)
Expand Down Expand Up @@ -105,16 +100,6 @@ static inline void tswap64s(uint64_t *s)
#define tswapls(s) tswap64s((uint64_t *)(s))
#endif

#if TARGET_LONG_SIZE == 4
typedef int32_t target_long;
typedef uint32_t target_ulong;
#elif TARGET_LONG_SIZE == 8
typedef int64_t target_long;
typedef uint64_t target_ulong;
#else
#error TARGET_LONG_SIZE undefined
#endif

/* types enums definitions */

typedef enum argtype {
Expand Down

0 comments on commit 35b66fc

Please sign in to comment.