mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
exec: Declare abi_ptr type in its own 'abi_ptr.h' header
The abi_ptr type is declared in "exec/cpu_ldst.h" with all the load/store helpers. Some source files requiring abi_ptr type don't need the load/store helpers. In order to simplify, create a new "exec/abi_ptr.h" header. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231212123401.37493-21-philmd@linaro.org>
This commit is contained in:
parent
d25ddb3f54
commit
471558cb6e
4 changed files with 41 additions and 15 deletions
33
include/exec/abi_ptr.h
Normal file
33
include/exec/abi_ptr.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* QEMU abi_ptr type definitions
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
#ifndef EXEC_ABI_PTR_H
|
||||
#define EXEC_ABI_PTR_H
|
||||
|
||||
#include "cpu-param.h"
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
/*
|
||||
* sparc32plus has 64bit long but 32bit space address
|
||||
* this can make bad result with g2h() and h2g()
|
||||
*/
|
||||
#if TARGET_VIRT_ADDR_SPACE_BITS <= 32
|
||||
typedef uint32_t abi_ptr;
|
||||
#define TARGET_ABI_FMT_ptr "%x"
|
||||
#else
|
||||
typedef uint64_t abi_ptr;
|
||||
#define TARGET_ABI_FMT_ptr "%"PRIx64
|
||||
#endif
|
||||
|
||||
#else /* !CONFIG_USER_ONLY */
|
||||
|
||||
#include "exec/target_long.h"
|
||||
|
||||
typedef target_ulong abi_ptr;
|
||||
#define TARGET_ABI_FMT_ptr TARGET_FMT_lx
|
||||
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue