Merge remote-tracking branch 'kwolf/for-anthony' into staging
[qemu-kvm.git] / linux-user / qemu-types.h
blobfe7f6624f9f209fa152dc8d8691fd0e5c3a78ee6
1 #ifndef QEMU_TYPES_H
2 #define QEMU_TYPES_H
3 #include "cpu.h"
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
13 static inline abi_ulong tswapal(abi_ulong v)
15 return tswap32(v);
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
30 static inline abi_ulong tswapal(abi_ulong v)
32 return tswapl(v);
35 #endif
36 #endif