if (!(state->master_elcr & (0x1 << irq))) {
state->master_irr &= ~(0x1 << irq);
}
+ } else {
+ PrintDebug("8259 PIC: (master) Ignoring begin_irq for %d since I don't own it\n",irq);
}
+
} else {
// This should always be true: See pic_get_intr_number
if (((state->slave_irr & ~(state->slave_imr)) >> (irq - 8)) & 0x01) {
if (!(state->slave_elcr & (0x1 << (irq - 8)))) {
state->slave_irr &= ~(0x1 << (irq - 8));
}
- }
+ } else {
+ PrintDebug("8259 PIC: (slave) Ignoring begin_irq for %d since I don't own it\n",irq);
+ }
+
}
return 0;
int req_irq = get_highest_irr(apic);
int svc_irq = get_highest_isr(apic);
+ PrintDebug("apic %u: core %u: req_irq=%d, svc_irq=%d\n",apic->lapic_id.val,info->cpu_id,req_irq,svc_irq);
+
if ((req_irq >= 0) &&
(req_irq > svc_irq)) {
return 1;
uchar_t * svc_location = apic->int_svc_reg + major_offset;
uchar_t flag = 0x01 << minor_offset;
- *svc_location |= flag;
- *req_location &= ~flag;
+ if (*req_location & flag) {
+ // we will only pay attention to a begin irq if we
+ // know that we initiated it!
+ *svc_location |= flag;
+ *req_location &= ~flag;
+ } else {
+ // do nothing...
+ PrintDebug("apic %u: core %u: begin irq for %d ignored since I don't own it\n",
+ apic->lapic_id.val,info->cpu_id,irq);
+ }