xref: /openbmc/qemu/include/exec/abi_ptr.h (revision 7c08eefc)
1 /*
2  * QEMU abi_ptr type definitions
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  */
6 #ifndef EXEC_ABI_PTR_H
7 #define EXEC_ABI_PTR_H
8 
9 #include "cpu-param.h"
10 
11 #if defined(CONFIG_USER_ONLY)
12 /*
13  * sparc32plus has 64bit long but 32bit space address
14  * this can make bad result with g2h() and h2g()
15  */
16 #if TARGET_VIRT_ADDR_SPACE_BITS <= 32
17 typedef uint32_t abi_ptr;
18 #define TARGET_ABI_FMT_ptr "%x"
19 #else
20 typedef uint64_t abi_ptr;
21 #define TARGET_ABI_FMT_ptr "%"PRIx64
22 #endif
23 
24 #else /* !CONFIG_USER_ONLY */
25 
26 #include "exec/target_long.h"
27 
28 typedef target_ulong abi_ptr;
29 #define TARGET_ABI_FMT_ptr TARGET_FMT_lx
30 
31 #endif /* !CONFIG_USER_ONLY */
32 
33 #endif
34