summaryrefslogtreecommitdiff
path: root/hw/apic.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-02 22:23:49 +0200
committerAndreas Färber <afaerber@suse.de>2012-10-31 01:02:39 +0100
commit60e82579c75068cb49af95595aa99d727e657a0a (patch)
tree4ccc33ee8444f12782c5491ffdfc56660d8c5c87 /hw/apic.c
parente9f9d6b16510776ae3d07e91b1cfb4d412701270 (diff)
cpus: Pass CPUState to qemu_cpu_is_self()
Change return type to bool, move to include/qemu/cpu.h and add documentation. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Igor Mammedov <imammedo@redhat.com> [AF: Updated new caller qemu_in_vcpu_thread()]
Diffstat (limited to 'hw/apic.c')
-rw-r--r--hw/apic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 4bc14e0c36..f73fc877aa 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -107,7 +107,7 @@ static void apic_sync_vapic(APICCommonState *s, int sync_type)
length = offsetof(VAPICState, enabled) - offsetof(VAPICState, isr);
if (sync_type & SYNC_TO_VAPIC) {
- assert(qemu_cpu_is_self(&s->cpu->env));
+ assert(qemu_cpu_is_self(CPU(s->cpu)));
vapic_state.tpr = s->tpr;
vapic_state.enabled = 1;
@@ -363,10 +363,12 @@ 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);
+
if (!(s->spurious_vec & APIC_SV_ENABLE)) {
return;
}
- if (!qemu_cpu_is_self(&s->cpu->env)) {
+ if (!qemu_cpu_is_self(cpu)) {
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_POLL);
} else if (apic_irq_pending(s) > 0) {
cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_HARD);