[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v16 20/99] target/arm: tcg: move sysemu-only parts of debug_helpe
From: |
Alex Bennée |
Subject: |
[PATCH v16 20/99] target/arm: tcg: move sysemu-only parts of debug_helper |
Date: |
Fri, 4 Jun 2021 16:51:53 +0100 |
From: Claudio Fontana <cfontana@suse.de>
move sysemu-only parts of debug_helper to sysemu/
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
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 6f014f77ec..1a4d7a0940 100644
--- a/target/arm/tcg/sysemu/meson.build
+++ b/target/arm/tcg/sysemu/meson.build
@@ -1,3 +1,4 @@
arm_softmmu_ss.add(when: 'CONFIG_TCG', if_true: files(
+ 'debug_helper.c',
'mte_helper.c',
))
--
2.20.1
- Re: [PATCH v16 63/99] tests/qtest: skip bios-tables-test test_acpi_oem_fields_virt for KVM, (continued)
- [PATCH v16 54/99] target/arm: move TCGCPUOps to tcg/tcg-cpu.c, Alex Bennée, 2021/06/04
- [PATCH v16 95/99] hw/arm: add dependency on OR_IRQ for XLNX_VERSAL, Alex Bennée, 2021/06/04
- [PATCH v16 45/99] target/arm: move sve_exception_el out of TCG helpers, Alex Bennée, 2021/06/04
- [PATCH v16 72/99] target/arm: cpu-sve: rename functions according to module prefix, Alex Bennée, 2021/06/04
- [PATCH v16 46/99] target/arm: fix comments style of fp_exception_el before moving it, Alex Bennée, 2021/06/04
- [PATCH v16 20/99] target/arm: tcg: move sysemu-only parts of debug_helper,
Alex Bennée <=
- [PATCH v16 55/99] target/arm: move cpu_tcg to tcg/tcg-cpu-models.c, Alex Bennée, 2021/06/04
- [PATCH v16 37/99] target/arm: move sve_zcr_len_for_el to common_cpu, Alex Bennée, 2021/06/04
- [PATCH v16 34/99] target/arm: move arm_hcr_el2_eff from tcg/ to common_cpu, Alex Bennée, 2021/06/04
- [PATCH v16 17/99] arm: tcg: only build under CONFIG_TCG, Alex Bennée, 2021/06/04
- [PATCH v16 42/99] target/arm: split 32bit and 64bit arm dump state, Alex Bennée, 2021/06/04
- Re: [PATCH v16 00/99] arm tcg/kvm refactor and split with kvm only support, Philippe Mathieu-Daudé, 2021/06/08