but after I check the isr register value (16 bit, 8 bits lower for master, 8 bits higher for slave) I got the value of
0x0001, the 8th bit is not set indicate it is a spurious irq... but the lowest bit is set to 1... what does it mean?
also can someone critique my code about handling the spurious irq??!!!!
Code: Select all
if (r->isr_num == 0x27){
outb(0x20,0xb);
outb(0xa0,0xb);
unsigned short isr = (inb(0xa0)<<8)| inb(0x20);
print(" ISR ---> ");
print_hex(isr);put('\n');
if ((isr&0x80)==0){
print("spurious master irq return!!\n");
return;
}
}
// spurious irq for slave
if (r->isr_num == 0x2f){
outb(0x20,0xb);
outb(0xa0,0xb);
unsigned short isr = (inb(0xa0)<<8)| inb(0x20);
print(" ISR ---> ");
print_hex(isr);put('\n');
if ((isr&0x8000)==0){
print("spurious slave irq return!!\n");
outb(0x20, 0x20); // acknowledge for the master
return;
}
}