From b4511723bdc0ead9b9b958ad20a4a8bf900d6243 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 8 Oct 2006 18:20:51 +0000 Subject: APIC init fix + APIC get_irq fix (Juergen Keil) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2193 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/apic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hw/apic.c') diff --git a/hw/apic.c b/hw/apic.c index aa6f2ef38f..6e66739479 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -382,8 +382,6 @@ static void apic_init_ipi(APICState *s) { int i; - for(i = 0; i < APIC_LVT_NB; i++) - s->lvt[i] = 1 << 16; /* mask LVT */ s->tpr = 0; s->spurious_vec = 0xff; s->log_dest = 0; @@ -391,7 +389,8 @@ static void apic_init_ipi(APICState *s) memset(s->isr, 0, sizeof(s->isr)); memset(s->tmr, 0, sizeof(s->tmr)); memset(s->irr, 0, sizeof(s->irr)); - memset(s->lvt, 0, sizeof(s->lvt)); + for(i = 0; i < APIC_LVT_NB; i++) + s->lvt[i] = 1 << 16; /* mask LVT */ s->esr = 0; memset(s->icr, 0, sizeof(s->icr)); s->divide_conf = 0; @@ -477,9 +476,9 @@ int apic_get_interrupt(CPUState *env) intno = get_highest_priority_int(s->irr); if (intno < 0) return -1; - reset_bit(s->irr, intno); if (s->tpr && intno <= s->tpr) return s->spurious_vec & 0xff; + reset_bit(s->irr, intno); set_bit(s->isr, intno); apic_update_irq(s); return intno; -- cgit v1.2.3