mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
translate-all: Move tcg_handle_interrupt() to -common
Move this function to common code. It has no arch specific dependencies. Prepares support for multi-arch where the translate-all interface needs to be virtualised. One less thing to virtualise. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-Id: <44a7c73604ed2552af47ed02b047b6a772b683e0.1441614289.git.crosthwaite.peter@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5abf9495ca
commit
9b68a7754a
3 changed files with 54 additions and 30 deletions
|
@ -1491,36 +1491,6 @@ void tb_check_watchpoint(CPUState *cpu)
|
|||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
/* mask must never be zero, except for A20 change call */
|
||||
static void tcg_handle_interrupt(CPUState *cpu, int mask)
|
||||
{
|
||||
int old_mask;
|
||||
|
||||
old_mask = cpu->interrupt_request;
|
||||
cpu->interrupt_request |= mask;
|
||||
|
||||
/*
|
||||
* If called from iothread context, wake the target cpu in
|
||||
* case its halted.
|
||||
*/
|
||||
if (!qemu_cpu_is_self(cpu)) {
|
||||
qemu_cpu_kick(cpu);
|
||||
return;
|
||||
}
|
||||
|
||||
if (use_icount) {
|
||||
cpu->icount_decr.u16.high = 0xffff;
|
||||
if (!cpu->can_do_io
|
||||
&& (mask & ~old_mask) != 0) {
|
||||
cpu_abort(cpu, "Raised interrupt while not in I/O function");
|
||||
}
|
||||
} else {
|
||||
cpu->tcg_exit_req = 1;
|
||||
}
|
||||
}
|
||||
|
||||
CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
|
||||
|
||||
/* in deterministic execution mode, instructions doing device I/Os
|
||||
must be at the end of the TB */
|
||||
void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue