[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v11 06/55] target/arm: tcg: move sysemu-only parts of debug_helper
From: |
Claudio Fontana |
Subject: |
[RFC v11 06/55] target/arm: tcg: move sysemu-only parts of debug_helper |
Date: |
Tue, 23 Mar 2021 16:17:00 +0100 |
move sysemu-only parts of debug_helper to sysemu/
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
target/arm/tcg/debug_helper.c | 27 -----------------------
target/arm/tcg/sysemu/debug_helper.c | 33 ++++++++++++++++++++++++++++
target/arm/tcg/sysemu/meson.build | 1 +
3 files changed, 34 insertions(+), 27 deletions(-)
create mode 100644 target/arm/tcg/sysemu/debug_helper.c
diff --git a/target/arm/tcg/debug_helper.c b/target/arm/tcg/debug_helper.c
index 2ff72d47d1..66a0915393 100644
--- a/target/arm/tcg/debug_helper.c
+++ b/target/arm/tcg/debug_helper.c
@@ -308,30 +308,3 @@ void arm_debug_excp_handler(CPUState *cs)
arm_debug_target_el(env));
}
}
-
-#if !defined(CONFIG_USER_ONLY)
-
-vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len)
-{
- ARMCPU *cpu = ARM_CPU(cs);
- CPUARMState *env = &cpu->env;
-
- /*
- * In BE32 system mode, target memory is stored byteswapped (on a
- * little-endian host system), and by the time we reach here (via an
- * opcode helper) the addresses of subword accesses have been adjusted
- * to account for that, which means that watchpoints will not match.
- * Undo the adjustment here.
- */
- if (arm_sctlr_b(env)) {
- if (len == 1) {
- addr ^= 3;
- } else if (len == 2) {
- addr ^= 2;
- }
- }
-
- return addr;
-}
-
-#endif
diff --git a/target/arm/tcg/sysemu/debug_helper.c
b/target/arm/tcg/sysemu/debug_helper.c
new file mode 100644
index 0000000000..0bce00144f
--- /dev/null
+++ b/target/arm/tcg/sysemu/debug_helper.c
@@ -0,0 +1,33 @@
+/*
+ * ARM debug helpers.
+ *
+ * This code is licensed under the GNU GPL v2 or later.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "internals.h"
+
+vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len)
+{
+ ARMCPU *cpu = ARM_CPU(cs);
+ CPUARMState *env = &cpu->env;
+
+ /*
+ * In BE32 system mode, target memory is stored byteswapped (on a
+ * little-endian host system), and by the time we reach here (via an
+ * opcode helper) the addresses of subword accesses have been adjusted
+ * to account for that, which means that watchpoints will not match.
+ * Undo the adjustment here.
+ */
+ if (arm_sctlr_b(env)) {
+ if (len == 1) {
+ addr ^= 3;
+ } else if (len == 2) {
+ addr ^= 2;
+ }
+ }
+
+ return addr;
+}
diff --git a/target/arm/tcg/sysemu/meson.build
b/target/arm/tcg/sysemu/meson.build
index fef41080ac..1d5e593c20 100644
--- a/target/arm/tcg/sysemu/meson.build
+++ b/target/arm/tcg/sysemu/meson.build
@@ -1,4 +1,5 @@
arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files(
'mte_helper.c',
+ 'debug_helper.c',
))
--
2.26.2
- [RFC v11 00/55] arm cleanup experiment for kvm-only build, Claudio Fontana, 2021/03/23
- [RFC v11 01/55] target/arm: move translate modules to tcg/, Claudio Fontana, 2021/03/23
- [RFC v11 02/55] target/arm: move helpers to tcg/, Claudio Fontana, 2021/03/23
- [RFC v11 03/55] arm: tcg: only build under CONFIG_TCG, Claudio Fontana, 2021/03/23
- [RFC v11 04/55] target/arm: tcg: add sysemu and user subdirs, Claudio Fontana, 2021/03/23
- [RFC v11 05/55] target/arm: tcg: split mte_helper user-only and sysemu code, Claudio Fontana, 2021/03/23
- [RFC v11 06/55] target/arm: tcg: move sysemu-only parts of debug_helper,
Claudio Fontana <=
- [RFC v11 07/55] target/arm: tcg: split tlb_helper user-only and sysemu-only parts, Claudio Fontana, 2021/03/23
- [RFC v11 10/55] target/arm: split off cpu-sysemu.c, Claudio Fontana, 2021/03/23
- [RFC v11 09/55] target/arm: only build psci for TCG, Claudio Fontana, 2021/03/23
- [RFC v11 12/55] target/arm: cpu-mmu: fix comment style, Claudio Fontana, 2021/03/23
- [RFC v11 08/55] target/arm: tcg: split m_helper user-only and sysemu-only parts, Claudio Fontana, 2021/03/23