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