]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
include/exec: Split out watchpoint.h
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 14 Mar 2025 17:39:19 +0000 (10:39 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 23 Apr 2025 21:08:36 +0000 (14:08 -0700)
Relatively few objects in qemu care about watchpoints, so split
out to a new header.  Removes an instance of CONFIG_USER_ONLY
from hw/core/cpu.h.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
14 files changed:
accel/tcg/tcg-accel-ops.c
include/exec/watchpoint.h [new file with mode: 0644]
include/hw/core/cpu.h
system/watchpoint.c
target/arm/debug_helper.c
target/i386/cpu.c
target/i386/machine.c
target/i386/tcg/system/bpt_helper.c
target/ppc/cpu.c
target/ppc/cpu_init.c
target/riscv/debug.c
target/s390x/helper.c
target/s390x/tcg/excp_helper.c
target/xtensa/dbg_helper.c

index d9b662efe3ba1a68e7f25e37be6956f130a6dc59..5c880561572c3867171661d8f9f2259693b7cad1 100644 (file)
@@ -37,6 +37,7 @@
 #include "exec/hwaddr.h"
 #include "exec/tb-flush.h"
 #include "exec/translation-block.h"
+#include "exec/watchpoint.h"
 #include "gdbstub/enums.h"
 
 #include "hw/core/cpu.h"
diff --git a/include/exec/watchpoint.h b/include/exec/watchpoint.h
new file mode 100644 (file)
index 0000000..4b66688
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * CPU watchpoints
+ *
+ * Copyright (c) 2012 SUSE LINUX Products GmbH
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef EXEC_WATCHPOINT_H
+#define EXEC_WATCHPOINT_H
+
+#if defined(CONFIG_USER_ONLY)
+static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
+                                        int flags, CPUWatchpoint **watchpoint)
+{
+    return -ENOSYS;
+}
+
+static inline int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
+                                        vaddr len, int flags)
+{
+    return -ENOSYS;
+}
+
+static inline void cpu_watchpoint_remove_by_ref(CPUState *cpu,
+                                                CPUWatchpoint *wp)
+{
+}
+
+static inline void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
+{
+}
+#else
+int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
+                          int flags, CPUWatchpoint **watchpoint);
+int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
+                          vaddr len, int flags);
+void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint);
+void cpu_watchpoint_remove_all(CPUState *cpu, int mask);
+#endif
+
+#endif /* EXEC_WATCHPOINT_H */
index abd8764e834d4a0115375891c172a3064ebc234a..37cb7d1531501838e1029bdf698fe1d9d534485f 100644 (file)
@@ -1109,36 +1109,6 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
     return false;
 }
 
-#if defined(CONFIG_USER_ONLY)
-static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
-                                        int flags, CPUWatchpoint **watchpoint)
-{
-    return -ENOSYS;
-}
-
-static inline int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
-                                        vaddr len, int flags)
-{
-    return -ENOSYS;
-}
-
-static inline void cpu_watchpoint_remove_by_ref(CPUState *cpu,
-                                                CPUWatchpoint *wp)
-{
-}
-
-static inline void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
-{
-}
-#else
-int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
-                          int flags, CPUWatchpoint **watchpoint);
-int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,
-                          vaddr len, int flags);
-void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint);
-void cpu_watchpoint_remove_all(CPUState *cpu, int mask);
-#endif
-
 /**
  * cpu_get_address_space:
  * @cpu: CPU to get address space from
index 08dbd8483d156381b82e62cb9be2f90bc99cee47..21d0bb36cae8dac03809d9551a57ed2df1f1d7a8 100644 (file)
@@ -21,6 +21,7 @@
 #include "qemu/error-report.h"
 #include "exec/cputlb.h"
 #include "exec/target_page.h"
+#include "exec/watchpoint.h"
 #include "hw/core/cpu.h"
 
 /* Add a watchpoint.  */
index a9a619ba6b1b48a2818ab1fab52f2a0bfc430b3f..473ee2af38ee34b7cff8ec9c072ae11192579454 100644 (file)
@@ -13,6 +13,7 @@
 #include "cpregs.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
+#include "exec/watchpoint.h"
 #include "system/tcg.h"
 
 #ifdef CONFIG_TCG
index 5c9f80b4ccebdb64d1131d0e4dd2f416e26b413f..c596e2174d91a644ec78de9ef899dcc523a29506 100644 (file)
@@ -35,6 +35,7 @@
 #include "standard-headers/asm-x86/kvm_para.h"
 #include "hw/qdev-properties.h"
 #include "hw/i386/topology.h"
+#include "exec/watchpoint.h"
 #ifndef CONFIG_USER_ONLY
 #include "system/reset.h"
 #include "qapi/qapi-commands-machine-target.h"
index 70f632a36fddaf9b5645a93b6521f16f1a750d33..6cb561c6322905359770a6c4662576af5b6080c6 100644 (file)
@@ -7,7 +7,7 @@
 #include "hw/i386/x86.h"
 #include "kvm/kvm_i386.h"
 #include "hw/xen/xen.h"
-
+#include "exec/watchpoint.h"
 #include "system/kvm.h"
 #include "system/kvm_xen.h"
 #include "system/tcg.h"
index be232c1ca9e55c3f739b79ca5d19c2be8561e282..08ccd3f5e69fa0e7f35ce0b800057e844a4f6f6b 100644 (file)
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
+#include "exec/watchpoint.h"
 #include "tcg/helper-tcg.h"
 
 
index bfcc695de7688e9a7459023867cee274d0e91fd1..4d8faaddee236f35cf7fae3b13c95ed3d2c3ced4 100644 (file)
@@ -22,6 +22,7 @@
 #include "cpu-models.h"
 #include "cpu-qom.h"
 #include "exec/log.h"
+#include "exec/watchpoint.h"
 #include "fpu/softfloat-helpers.h"
 #include "mmu-hash64.h"
 #include "helper_regs.h"
index f81cb680fc38f0a604caf062e91635b2546728f5..17f0f3d3ffafb0efb02afe2b9bccd0d9c9ad8985 100644 (file)
@@ -40,7 +40,7 @@
 #include "qemu/cutils.h"
 #include "disas/capstone.h"
 #include "fpu/softfloat.h"
-
+#include "exec/watchpoint.h"
 #include "helper_regs.h"
 #include "internal.h"
 #include "spr_common.h"
index 9db4048523e832b5bdfe2ee24da20d24c82fc0f6..fea989afe97c536da4791b428915e0e9841a2b19 100644 (file)
@@ -30,6 +30,7 @@
 #include "trace.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
+#include "exec/watchpoint.h"
 #include "system/cpu-timers.h"
 
 /*
index c689e11b46c99948b15a96dd900b734d497ae343..e660c69f60963723e06ea6c411334f585c8bf889 100644 (file)
@@ -27,6 +27,7 @@
 #include "target/s390x/kvm/pv.h"
 #include "system/hw_accel.h"
 #include "system/runstate.h"
+#include "exec/watchpoint.h"
 
 void s390x_tod_timer(void *opaque)
 {
index ac733f407f75671736729537c3c18a51048718c7..1d51043e881992bd4a5838ac395d29bf89e2c653 100644 (file)
@@ -24,6 +24,7 @@
 #include "exec/helper-proto.h"
 #include "exec/cputlb.h"
 #include "exec/exec-all.h"
+#include "exec/watchpoint.h"
 #include "s390x-internal.h"
 #include "tcg_s390x.h"
 #ifndef CONFIG_USER_ONLY
index 163a1ffc7b6381a533d868111dd47669a6dcd414..c4f4298a50cc9bcd69af3e73a021b2497029a958 100644 (file)
@@ -31,6 +31,7 @@
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
 #include "exec/exec-all.h"
+#include "exec/watchpoint.h"
 #include "system/address-spaces.h"
 
 void HELPER(wsr_ibreakenable)(CPUXtensaState *env, uint32_t v)