Skip to content

Commit

Permalink
accel/tcg: Inline need_replay_interrupt
Browse files Browse the repository at this point in the history
The function is now trivial, and with inlining we can
re-use the calling function's tcg_ops variable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jan 29, 2024
1 parent 6ae7548 commit b7e9a4a
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,20 +765,6 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
return false;
}

#ifndef CONFIG_USER_ONLY
/*
* CPU_INTERRUPT_POLL is a virtual event which gets converted into a
* "real" interrupt event later. It does not need to be recorded for
* replay purposes.
*/
static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_request)
{
const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
return !tcg_ops->need_replay_interrupt
|| tcg_ops->need_replay_interrupt(interrupt_request);
}
#endif /* !CONFIG_USER_ONLY */

static inline bool icount_exit_request(CPUState *cpu)
{
if (!icount_enabled()) {
Expand Down Expand Up @@ -862,7 +848,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,

if (tcg_ops->cpu_exec_interrupt &&
tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) {
if (need_replay_interrupt(cpu, interrupt_request)) {
if (!tcg_ops->need_replay_interrupt ||
tcg_ops->need_replay_interrupt(interrupt_request)) {
replay_interrupt();
}
/*
Expand Down

0 comments on commit b7e9a4a

Please sign in to comment.