]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h'
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 Dec 2023 10:27:18 +0000 (11:27 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 26 Apr 2024 15:03:05 +0000 (17:03 +0200)
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>
13 files changed:
MAINTAINERS
bsd-user/freebsd/target_os_elf.h
bsd-user/freebsd/target_os_stack.h
bsd-user/netbsd/target_os_elf.h
bsd-user/openbsd/target_os_elf.h
bsd-user/signal.c
bsd-user/strace.c
include/exec/cpu-all.h
include/exec/user/abitypes.h
include/user/tswap-target.h [new file with mode: 0644]
linux-user/elfload.c
linux-user/i386/signal.c
linux-user/ppc/signal.c

index 96411e6adf78b09d54131cece6c8bc7af853b8e1..302b6fd00c4da11e40088521198c936319b2ce9a 100644 (file)
@@ -3692,6 +3692,7 @@ Overall usermode emulation
 M: Riku Voipio <riku.voipio@iki.fi>
 S: Maintained
 F: accel/tcg/user-exec*.c
+F: include/exec/user/
 F: include/user/
 F: common-user/
 
index 9df17d56d8a910b61ee2e8268c4934c89bf87a9d..01124979f798e76e8b8ac27a844203596c156c51 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "target_arch_elf.h"
 #include "elf.h"
+#include "user/tswap-target.h"
 
 #define bsd_get_ncpu() 1 /* until we pull in bsd-proc.[hc] */
 
index d15fc3263fcdfcf33455a7a8ad26ea4bd2c3be51..ac0ef22cd7abb2b7eb19a76b42d63999a570efaa 100644 (file)
@@ -23,6 +23,7 @@
 #include <sys/param.h>
 #include "target_arch_sigtramp.h"
 #include "qemu/guest-random.h"
+#include "user/tswap-target.h"
 
 /*
  * The initial FreeBSD stack is as follows:
index 2f3cb2087182352c695c0b18201fadfe9054965b..9de0f290c0c9316b85c4e9e2cc0e13c964e5b945 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "target_arch_elf.h"
 #include "elf.h"
+#include "user/tswap-target.h"
 
 /* this flag is uneffective under linux too, should be deleted */
 #ifndef MAP_DENYWRITE
index 6dca9c5a8537d1a716700c6ed87d62e7084f6056..4cf5747dcd42e5b8344c802526b5ad74d6ba8818 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "target_arch_elf.h"
 #include "elf.h"
+#include "user/tswap-target.h"
 
 /* this flag is uneffective under linux too, should be deleted */
 #ifndef MAP_DENYWRITE
index e5a773dddeeffb375ce08ac7ede4c8e5aca00871..b2faf1d0dd834edf7d37fd247428ceeda682d184 100644 (file)
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "qemu/log.h"
 #include "qemu.h"
+#include "user/tswap-target.h"
 #include "gdbstub/user.h"
 #include "signal-common.h"
 #include "trace.h"
index 96499751eb081a11af353014f9cca3a1573a9215..6dc01d3be7e042e657d1ee718085a73de140772d 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/ioccom.h>
 
 #include "qemu.h"
+#include "user/tswap-target.h"
 
 #include "os-strace.h"  /* OS dependent strace print functions */
 
index 7c44ffb3afdcbf058af20c989ca63ba64e43ca96..78848f018c76a74e310cec16961650911c76de88 100644 (file)
 #define BSWAP_NEEDED
 #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
  * {ld,st}{type}{sign}{size}{endian}_p naming scheme described in bswap.h.
  */
index db4a6703285d4f1d7c92527d69ab068bd03a3076..731f345ff5068bb9de6a95e01e873b32d2946256 100644 (file)
@@ -2,6 +2,7 @@
 #define EXEC_USER_ABITYPES_H
 
 #include "cpu.h"
+#include "user/tswap-target.h"
 
 #ifdef TARGET_ABI32
 #define TARGET_ABI_BITS 32
diff --git a/include/user/tswap-target.h b/include/user/tswap-target.h
new file mode 100644 (file)
index 0000000..4719330
--- /dev/null
@@ -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
index a0999dac1560562f9bee14b2d3a79cff3477942d..207455c1baa1a6f88419869bf7827b69700a3b92 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/shm.h>
 
 #include "qemu.h"
+#include "user/tswap-target.h"
 #include "user-internals.h"
 #include "signal-common.h"
 #include "loader.h"
index cfe70fc5cffd9029d1790d2a9bf180f7ced74652..990048f42ac5349919ed6a049643964f8b5e3edf 100644 (file)
@@ -21,6 +21,7 @@
 #include "user-internals.h"
 #include "signal-common.h"
 #include "linux-user/trace.h"
+#include "user/tswap-target.h"
 
 /* from the Linux kernel - /arch/x86/include/uapi/asm/sigcontext.h */
 
index 652038a53ce59da51e15c75fb407ec74f0f1bfe9..a1d8c0bccc12c5199edeeb90eb1c9a36095a6bc5 100644 (file)
@@ -21,6 +21,7 @@
 #include "user-internals.h"
 #include "signal-common.h"
 #include "linux-user/trace.h"
+#include "user/tswap-target.h"
 #include "vdso-asmoffset.h"
 
 /* See arch/powerpc/include/asm/ucontext.h.  Only used for 32-bit PPC;