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