aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-12-12 11:27:18 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-04-26 17:03:05 +0200
commit827238668e7dc44e43e71a3e12b605881fe6887e (patch)
treef0311bc47207fc93bfa8df8176afe947570ffa99 /include
parent425082612c012843d8b33fa0d35966adf5600c47 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/exec/cpu-all.h8
-rw-r--r--include/exec/user/abitypes.h1
-rw-r--r--include/user/tswap-target.h22
3 files changed, 23 insertions, 8 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 7c44ffb3af..78848f018c 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -36,14 +36,6 @@
#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.
*/
diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index db4a670328..731f345ff5 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -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
index 0000000000..4719330dbb
--- /dev/null
+++ b/include/user/tswap-target.h
@@ -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