mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
cpu: Pass CPUState to cpu_interrupt()
Move it to qom/cpu.h to avoid issues with include order. Change pc_acpi_smi_interrupt() opaque to X86CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
d8ed887bdc
commit
c3affe5670
37 changed files with 106 additions and 99 deletions
21
hw/apic.c
21
hw/apic.c
|
@ -151,15 +151,15 @@ static void apic_local_deliver(APICCommonState *s, int vector)
|
|||
|
||||
switch ((lvt >> 8) & 7) {
|
||||
case APIC_DM_SMI:
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_SMI);
|
||||
cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_SMI);
|
||||
break;
|
||||
|
||||
case APIC_DM_NMI:
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_NMI);
|
||||
cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_NMI);
|
||||
break;
|
||||
|
||||
case APIC_DM_EXTINT:
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_HARD);
|
||||
cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_HARD);
|
||||
break;
|
||||
|
||||
case APIC_DM_FIXED:
|
||||
|
@ -248,20 +248,20 @@ static void apic_bus_deliver(const uint32_t *deliver_bitmask,
|
|||
|
||||
case APIC_DM_SMI:
|
||||
foreach_apic(apic_iter, deliver_bitmask,
|
||||
cpu_interrupt(&apic_iter->cpu->env, CPU_INTERRUPT_SMI)
|
||||
cpu_interrupt(CPU(apic_iter->cpu), CPU_INTERRUPT_SMI)
|
||||
);
|
||||
return;
|
||||
|
||||
case APIC_DM_NMI:
|
||||
foreach_apic(apic_iter, deliver_bitmask,
|
||||
cpu_interrupt(&apic_iter->cpu->env, CPU_INTERRUPT_NMI)
|
||||
cpu_interrupt(CPU(apic_iter->cpu), CPU_INTERRUPT_NMI)
|
||||
);
|
||||
return;
|
||||
|
||||
case APIC_DM_INIT:
|
||||
/* normal INIT IPI sent to processors */
|
||||
foreach_apic(apic_iter, deliver_bitmask,
|
||||
cpu_interrupt(&apic_iter->cpu->env,
|
||||
cpu_interrupt(CPU(apic_iter->cpu),
|
||||
CPU_INTERRUPT_INIT)
|
||||
);
|
||||
return;
|
||||
|
@ -363,15 +363,16 @@ static int apic_irq_pending(APICCommonState *s)
|
|||
/* signal the CPU if an irq is pending */
|
||||
static void apic_update_irq(APICCommonState *s)
|
||||
{
|
||||
CPUState *cpu = CPU(s->cpu);
|
||||
CPUState *cpu;
|
||||
|
||||
if (!(s->spurious_vec & APIC_SV_ENABLE)) {
|
||||
return;
|
||||
}
|
||||
cpu = CPU(s->cpu);
|
||||
if (!qemu_cpu_is_self(cpu)) {
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_POLL);
|
||||
cpu_interrupt(cpu, CPU_INTERRUPT_POLL);
|
||||
} else if (apic_irq_pending(s) > 0) {
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_HARD);
|
||||
cpu_interrupt(cpu, CPU_INTERRUPT_HARD);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,7 +479,7 @@ static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask,
|
|||
static void apic_startup(APICCommonState *s, int vector_num)
|
||||
{
|
||||
s->sipi_vector = vector_num;
|
||||
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_SIPI);
|
||||
cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_SIPI);
|
||||
}
|
||||
|
||||
void apic_sipi(DeviceState *d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue