@samitouri / QOSamiQemu / commits / 032731dbaf

cpu: Move cpu_breakpoint_test out of line

Move the function to cpu-common.c, with the other breakpoint functions. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-ID: <20260705215729.62196-19-philmd@oss.qualcomm.com>

Richard Henderson committed Jun 30, 2026 at 20:04 UTC 032731dbafb6a21173205230270dadfa01080af3
2 files changed +16 -15
cpu-common.c
+15
@@ -388,6 +388,21 @@ void process_queued_cpu_work(CPUState *cpu)
388 qemu_cond_broadcast(&qemu_work_cond);
389 }
390
391 +/* Return true if PC matches an installed breakpoint. */
392 +bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
393 +{
394 + CPUBreakpoint *bp;
395 +
396 + if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
397 + QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
398 + if (bp->pc == pc && (bp->flags & mask)) {
399 + return true;
400 + }
401 + }
402 + }
403 + return false;
404 +}
405 +
406 /* Add a breakpoint. */
407 int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
408 CPUBreakpoint **breakpoint)
include/hw/core/cpu.h
+1 -15
@@ -1157,21 +1157,7 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
1157 int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags);
1158 void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint);
1159 void cpu_breakpoint_remove_all(CPUState *cpu, int mask);
1160 -
1161 -/* Return true if PC matches an installed breakpoint. */
1162 -static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
1163 -{
1164 - CPUBreakpoint *bp;
1165 -
1166 - if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
1167 - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
1168 - if (bp->pc == pc && (bp->flags & mask)) {
1169 - return true;
1170 - }
1171 - }
1172 - }
1173 - return false;
1174 -}
1160 +bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask);
1161
1162 /**
1163 * cpu_get_address_space: