Commit b4511723bdc0ead9b9b958ad20a4a8bf900d6243
1 parent
d1beab82
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
Showing
1 changed file
with
3 additions
and
4 deletions
hw/apic.c
... | ... | @@ -382,8 +382,6 @@ static void apic_init_ipi(APICState *s) |
382 | 382 | { |
383 | 383 | int i; |
384 | 384 | |
385 | - for(i = 0; i < APIC_LVT_NB; i++) | |
386 | - s->lvt[i] = 1 << 16; /* mask LVT */ | |
387 | 385 | s->tpr = 0; |
388 | 386 | s->spurious_vec = 0xff; |
389 | 387 | s->log_dest = 0; |
... | ... | @@ -391,7 +389,8 @@ static void apic_init_ipi(APICState *s) |
391 | 389 | memset(s->isr, 0, sizeof(s->isr)); |
392 | 390 | memset(s->tmr, 0, sizeof(s->tmr)); |
393 | 391 | memset(s->irr, 0, sizeof(s->irr)); |
394 | - memset(s->lvt, 0, sizeof(s->lvt)); | |
392 | + for(i = 0; i < APIC_LVT_NB; i++) | |
393 | + s->lvt[i] = 1 << 16; /* mask LVT */ | |
395 | 394 | s->esr = 0; |
396 | 395 | memset(s->icr, 0, sizeof(s->icr)); |
397 | 396 | s->divide_conf = 0; |
... | ... | @@ -477,9 +476,9 @@ int apic_get_interrupt(CPUState *env) |
477 | 476 | intno = get_highest_priority_int(s->irr); |
478 | 477 | if (intno < 0) |
479 | 478 | return -1; |
480 | - reset_bit(s->irr, intno); | |
481 | 479 | if (s->tpr && intno <= s->tpr) |
482 | 480 | return s->spurious_vec & 0xff; |
481 | + reset_bit(s->irr, intno); | |
483 | 482 | set_bit(s->isr, intno); |
484 | 483 | apic_update_irq(s); |
485 | 484 | return intno; | ... | ... |