mirror of
https://github.com/qemu/qemu.git
synced 2025-01-18 11:33:27 +08:00
PIC spurious irq support (aka Solaris install bug)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@838 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
28ab0e2edb
commit
15aeac3805
@ -14,6 +14,7 @@ version 0.5.6:
|
|||||||
- dummy VGA PCI support
|
- dummy VGA PCI support
|
||||||
- VGA font selection fix (Daniel Serpell)
|
- VGA font selection fix (Daniel Serpell)
|
||||||
- PIC reset fix (Hidemi KAWAI)
|
- PIC reset fix (Hidemi KAWAI)
|
||||||
|
- PIC spurious irq support (aka Solaris install bug)
|
||||||
|
|
||||||
version 0.5.5:
|
version 0.5.5:
|
||||||
|
|
||||||
|
51
hw/i8259.c
51
hw/i8259.c
@ -49,7 +49,6 @@ typedef struct PicState {
|
|||||||
|
|
||||||
/* 0 is master pic, 1 is slave pic */
|
/* 0 is master pic, 1 is slave pic */
|
||||||
static PicState pics[2];
|
static PicState pics[2];
|
||||||
static int pic_irq_requested;
|
|
||||||
|
|
||||||
/* set irq level. If an edge is detected, then the IRR is set to 1 */
|
/* set irq level. If an edge is detected, then the IRR is set to 1 */
|
||||||
static inline void pic_set_irq1(PicState *s, int irq, int level)
|
static inline void pic_set_irq1(PicState *s, int irq, int level)
|
||||||
@ -130,13 +129,6 @@ static void pic_update_irq(void)
|
|||||||
/* look at requested irq */
|
/* look at requested irq */
|
||||||
irq = pic_get_irq(&pics[0]);
|
irq = pic_get_irq(&pics[0]);
|
||||||
if (irq >= 0) {
|
if (irq >= 0) {
|
||||||
if (irq == 2) {
|
|
||||||
/* from slave pic */
|
|
||||||
pic_irq_requested = 8 + irq2;
|
|
||||||
} else {
|
|
||||||
/* from master pic */
|
|
||||||
pic_irq_requested = irq;
|
|
||||||
}
|
|
||||||
#if defined(DEBUG_PIC)
|
#if defined(DEBUG_PIC)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -192,8 +184,31 @@ int cpu_get_pic_interrupt(CPUState *env)
|
|||||||
{
|
{
|
||||||
int irq, irq2, intno;
|
int irq, irq2, intno;
|
||||||
|
|
||||||
/* signal the pic that the irq was acked by the CPU */
|
/* read the irq from the PIC */
|
||||||
irq = pic_irq_requested;
|
|
||||||
|
irq = pic_get_irq(&pics[0]);
|
||||||
|
if (irq >= 0) {
|
||||||
|
pic_intack(&pics[0], irq);
|
||||||
|
if (irq == 2) {
|
||||||
|
irq2 = pic_get_irq(&pics[1]);
|
||||||
|
if (irq2 >= 0) {
|
||||||
|
pic_intack(&pics[1], irq2);
|
||||||
|
} else {
|
||||||
|
/* spurious IRQ on slave controller */
|
||||||
|
irq2 = 7;
|
||||||
|
}
|
||||||
|
intno = pics[1].irq_base + irq2;
|
||||||
|
irq = irq2 + 8;
|
||||||
|
} else {
|
||||||
|
intno = pics[0].irq_base + irq;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* spurious IRQ on host controller */
|
||||||
|
irq = 7;
|
||||||
|
intno = pics[0].irq_base + irq;
|
||||||
|
}
|
||||||
|
pic_update_irq();
|
||||||
|
|
||||||
#ifdef DEBUG_IRQ_LATENCY
|
#ifdef DEBUG_IRQ_LATENCY
|
||||||
printf("IRQ%d latency=%0.3fus\n",
|
printf("IRQ%d latency=%0.3fus\n",
|
||||||
irq,
|
irq,
|
||||||
@ -202,17 +217,6 @@ int cpu_get_pic_interrupt(CPUState *env)
|
|||||||
#if defined(DEBUG_PIC)
|
#if defined(DEBUG_PIC)
|
||||||
printf("pic_interrupt: irq=%d\n", irq);
|
printf("pic_interrupt: irq=%d\n", irq);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (irq >= 8) {
|
|
||||||
irq2 = irq & 7;
|
|
||||||
pic_intack(&pics[1], irq2);
|
|
||||||
irq = 2;
|
|
||||||
intno = pics[1].irq_base + irq2;
|
|
||||||
} else {
|
|
||||||
intno = pics[0].irq_base + irq;
|
|
||||||
}
|
|
||||||
pic_intack(&pics[0], irq);
|
|
||||||
pic_update_irq();
|
|
||||||
return intno;
|
return intno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,9 +456,10 @@ void pic_info(void)
|
|||||||
|
|
||||||
for(i=0;i<2;i++) {
|
for(i=0;i<2;i++) {
|
||||||
s = &pics[i];
|
s = &pics[i];
|
||||||
term_printf("pic%d: irr=%02x imr=%02x isr=%02x hprio=%d irq_base=%02x rr_sel=%d elcr=%02x\n",
|
term_printf("pic%d: irr=%02x imr=%02x isr=%02x hprio=%d irq_base=%02x rr_sel=%d elcr=%02x fnm=%d\n",
|
||||||
i, s->irr, s->imr, s->isr, s->priority_add,
|
i, s->irr, s->imr, s->isr, s->priority_add,
|
||||||
s->irq_base, s->read_reg_select, s->elcr);
|
s->irq_base, s->read_reg_select, s->elcr,
|
||||||
|
s->special_fully_nested_mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user