static int pic_intr_pending_from_master(struct guest_info * info, void * private_data) {
struct pic_internal * state = (struct pic_internal*)private_data;
- return state->master_irr & (~(state->master_imr));
+ return state->master_irr // interrupt pending in the master's irr
+ & (~(state->master_imr)) // and is not masked in the master
+ & (~(state->master_icw3)); // and the pin is not hooked to slave
}
static int pic_intr_pending_from_slave(struct guest_info * info, void * private_data) {
if (IS_OCW2(cw)) {
// handle the EOI here
struct ocw2 * cw2 = (struct ocw2*)&cw;
- int eoi_irq;
+ int eoi_irq=-1;
PrintDebug(core->vm_info, core, "8259 PIC: Master: Handling OCW2 = %x (wr_Master1)\n", cw);
state->slave_state = ICW2;
} else if (state->slave_state == READY) {
if (IS_OCW2(cw)) {
- int eoi_irq;
+ int eoi_irq = -1;
// handle the EOI here
struct ocw2 * cw2 = (struct ocw2 *)&cw;