root / linux-user / qemu-types.h @ 93148aa5
History | View | Annotate | Download (742 Bytes)
1 |
#ifndef QEMU_TYPES_H
|
---|---|
2 |
#define QEMU_TYPES_H
|
3 |
#include "cpu.h" |
4 |
|
5 |
#ifdef TARGET_ABI32
|
6 |
typedef uint32_t abi_ulong;
|
7 |
typedef int32_t abi_long;
|
8 |
#define TARGET_ABI_FMT_lx "%08x" |
9 |
#define TARGET_ABI_FMT_ld "%d" |
10 |
#define TARGET_ABI_FMT_lu "%u" |
11 |
#define TARGET_ABI_BITS 32 |
12 |
|
13 |
static inline abi_ulong tswapal(abi_ulong v) |
14 |
{ |
15 |
return tswap32(v);
|
16 |
} |
17 |
|
18 |
#else
|
19 |
typedef target_ulong abi_ulong;
|
20 |
typedef target_long abi_long;
|
21 |
#define TARGET_ABI_FMT_lx TARGET_FMT_lx
|
22 |
#define TARGET_ABI_FMT_ld TARGET_FMT_ld
|
23 |
#define TARGET_ABI_FMT_lu TARGET_FMT_lu
|
24 |
#define TARGET_ABI_BITS TARGET_LONG_BITS
|
25 |
/* for consistency, define ABI32 too */
|
26 |
#if TARGET_ABI_BITS == 32 |
27 |
#define TARGET_ABI32 1 |
28 |
#endif
|
29 |
|
30 |
static inline abi_ulong tswapal(abi_ulong v) |
31 |
{ |
32 |
return tswapl(v);
|
33 |
} |
34 |
|
35 |
#endif
|
36 |
#endif
|