On 22/4/25 21:26, Richard Henderson wrote:
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.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
include/exec/watchpoint.h | 41 +++++++++++++++++++++++++++++
include/hw/core/cpu.h | 30 ---------------------
accel/tcg/tcg-accel-ops.c | 1 +
system/watchpoint.c | 1 +
target/arm/debug_helper.c | 1 +
target/i386/cpu.c | 1 +
target/i386/machine.c | 2 +-
target/i386/tcg/system/bpt_helper.c | 1 +
target/ppc/cpu.c | 1 +
target/ppc/cpu_init.c | 2 +-
target/riscv/debug.c | 1 +
target/s390x/helper.c | 1 +
target/s390x/tcg/excp_helper.c | 1 +
target/xtensa/dbg_helper.c | 1 +
14 files changed, 53 insertions(+), 32 deletions(-)
create mode 100644 include/exec/watchpoint.h
diff --git a/include/exec/watchpoint.h b/include/exec/watchpoint.h
new file mode 100644
index 0000000000..4b6668826c
--- /dev/null
+++ b/include/exec/watchpoint.h
@@ -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 */
Should we also move the CPUWatchpoint definition?
Can be done later, so:
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>