mirror of https://gitlab.com/qemu-project/qemu
exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h'
tswapl() and bswaptls() are target-dependent and only used by user emulation. Move their definitions to a new header: "exec/user/tswap-target.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Anton Johansson <anjo@rev.ng> Message-Id: <20231212123401.37493-17-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
425082612c
commit
827238668e
|
@ -3692,6 +3692,7 @@ Overall usermode emulation
|
||||||
M: Riku Voipio <riku.voipio@iki.fi>
|
M: Riku Voipio <riku.voipio@iki.fi>
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: accel/tcg/user-exec*.c
|
F: accel/tcg/user-exec*.c
|
||||||
|
F: include/exec/user/
|
||||||
F: include/user/
|
F: include/user/
|
||||||
F: common-user/
|
F: common-user/
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "target_arch_elf.h"
|
#include "target_arch_elf.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
#define bsd_get_ncpu() 1 /* until we pull in bsd-proc.[hc] */
|
#define bsd_get_ncpu() 1 /* until we pull in bsd-proc.[hc] */
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include "target_arch_sigtramp.h"
|
#include "target_arch_sigtramp.h"
|
||||||
#include "qemu/guest-random.h"
|
#include "qemu/guest-random.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The initial FreeBSD stack is as follows:
|
* The initial FreeBSD stack is as follows:
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "target_arch_elf.h"
|
#include "target_arch_elf.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
/* this flag is uneffective under linux too, should be deleted */
|
/* this flag is uneffective under linux too, should be deleted */
|
||||||
#ifndef MAP_DENYWRITE
|
#ifndef MAP_DENYWRITE
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "target_arch_elf.h"
|
#include "target_arch_elf.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
/* this flag is uneffective under linux too, should be deleted */
|
/* this flag is uneffective under linux too, should be deleted */
|
||||||
#ifndef MAP_DENYWRITE
|
#ifndef MAP_DENYWRITE
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
#include "qemu.h"
|
#include "qemu.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
#include "gdbstub/user.h"
|
#include "gdbstub/user.h"
|
||||||
#include "signal-common.h"
|
#include "signal-common.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <sys/ioccom.h>
|
#include <sys/ioccom.h>
|
||||||
|
|
||||||
#include "qemu.h"
|
#include "qemu.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
#include "os-strace.h" /* OS dependent strace print functions */
|
#include "os-strace.h" /* OS dependent strace print functions */
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,6 @@
|
||||||
#define BSWAP_NEEDED
|
#define BSWAP_NEEDED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TARGET_LONG_SIZE == 4
|
|
||||||
#define tswapl(s) tswap32(s)
|
|
||||||
#define bswaptls(s) bswap32s(s)
|
|
||||||
#else
|
|
||||||
#define tswapl(s) tswap64(s)
|
|
||||||
#define bswaptls(s) bswap64s(s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Target-endianness CPU memory access functions. These fit into the
|
/* Target-endianness CPU memory access functions. These fit into the
|
||||||
* {ld,st}{type}{sign}{size}{endian}_p naming scheme described in bswap.h.
|
* {ld,st}{type}{sign}{size}{endian}_p naming scheme described in bswap.h.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define EXEC_USER_ABITYPES_H
|
#define EXEC_USER_ABITYPES_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
#ifdef TARGET_ABI32
|
#ifdef TARGET_ABI32
|
||||||
#define TARGET_ABI_BITS 32
|
#define TARGET_ABI_BITS 32
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* target-specific swap() definitions
|
||||||
|
*
|
||||||
|
* Copyright (c) 2003 Fabrice Bellard
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
*/
|
||||||
|
#ifndef USER_TSWAP_H
|
||||||
|
#define USER_TSWAP_H
|
||||||
|
|
||||||
|
#include "exec/cpu-defs.h"
|
||||||
|
#include "exec/tswap.h"
|
||||||
|
|
||||||
|
#if TARGET_LONG_SIZE == 4
|
||||||
|
#define tswapl(s) tswap32(s)
|
||||||
|
#define bswaptls(s) bswap32s(s)
|
||||||
|
#else
|
||||||
|
#define tswapl(s) tswap64(s)
|
||||||
|
#define bswaptls(s) bswap64s(s)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -7,6 +7,7 @@
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
#include "qemu.h"
|
#include "qemu.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
#include "user-internals.h"
|
#include "user-internals.h"
|
||||||
#include "signal-common.h"
|
#include "signal-common.h"
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "user-internals.h"
|
#include "user-internals.h"
|
||||||
#include "signal-common.h"
|
#include "signal-common.h"
|
||||||
#include "linux-user/trace.h"
|
#include "linux-user/trace.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
|
|
||||||
/* from the Linux kernel - /arch/x86/include/uapi/asm/sigcontext.h */
|
/* from the Linux kernel - /arch/x86/include/uapi/asm/sigcontext.h */
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "user-internals.h"
|
#include "user-internals.h"
|
||||||
#include "signal-common.h"
|
#include "signal-common.h"
|
||||||
#include "linux-user/trace.h"
|
#include "linux-user/trace.h"
|
||||||
|
#include "user/tswap-target.h"
|
||||||
#include "vdso-asmoffset.h"
|
#include "vdso-asmoffset.h"
|
||||||
|
|
||||||
/* See arch/powerpc/include/asm/ucontext.h. Only used for 32-bit PPC;
|
/* See arch/powerpc/include/asm/ucontext.h. Only used for 32-bit PPC;
|
||||||
|
|
Loading…
Reference in New Issue