aboutsummaryrefslogtreecommitdiff
path: root/hw/apic.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-10-08 18:20:51 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-10-08 18:20:51 +0000
commitb4511723bdc0ead9b9b958ad20a4a8bf900d6243 (patch)
tree95ccfce7b54c9e0c9ff213706cc9a3ae2e17ea4c /hw/apic.c
parentd1beab8220d1a7535bbaa44e3821922dbbad3677 (diff)
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
Diffstat (limited to 'hw/apic.c')
-rw-r--r--hw/apic.c7
1 files changed, 3 insertions, 4 deletions
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;