mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:17 +00:00
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>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
0533f08413
commit
032731dbaf
15
cpu-common.c
15
cpu-common.c
@@ -388,6 +388,21 @@ void process_queued_cpu_work(CPUState *cpu)
|
||||
qemu_cond_broadcast(&qemu_work_cond);
|
||||
}
|
||||
|
||||
/* Return true if PC matches an installed breakpoint. */
|
||||
bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
|
||||
{
|
||||
CPUBreakpoint *bp;
|
||||
|
||||
if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
|
||||
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
|
||||
if (bp->pc == pc && (bp->flags & mask)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Add a breakpoint. */
|
||||
int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
|
||||
CPUBreakpoint **breakpoint)
|
||||
|
||||
@@ -1157,21 +1157,7 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
|
||||
int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags);
|
||||
void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint);
|
||||
void cpu_breakpoint_remove_all(CPUState *cpu, int mask);
|
||||
|
||||
/* Return true if PC matches an installed breakpoint. */
|
||||
static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)
|
||||
{
|
||||
CPUBreakpoint *bp;
|
||||
|
||||
if (unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) {
|
||||
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
|
||||
if (bp->pc == pc && (bp->flags & mask)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask);
|
||||
|
||||
/**
|
||||
* cpu_get_address_space:
|
||||
|
||||
Reference in New Issue
Block a user