return -1;
}
if (hi_val) {
- PrintDebug("ioapic %u: Writing to hi of pin %d\n", ioapic->ioapic_id.val, redir_index);
+ PrintDebug("ioapic %u: Writing to hi of pin %d\n", ioapic->ioapic_id.id, redir_index);
ioapic->redir_tbl[redir_index].hi = op_val;
} else {
PrintDebug("ioapic %u: Writing to lo of pin %d\n", ioapic->ioapic_id.id, redir_index);
irq_entry = &(ioapic->redir_tbl[irq]);
if (irq_entry->mask == 0) {
+ struct v3_gen_ipi ipi;
PrintDebug("ioapic %u: IOAPIC Signalling APIC to raise INTR %d\n",
ioapic->ioapic_id.id, irq_entry->vec);
-
- // May need these for future reference
- // icr.val = irq_entry->val;
- // icr.trig_mode = irq_entry->trig_mode;
- PrintDebug("io apic: raising irq %u\n", irq);
-
-
- v3_apic_raise_intr(vm, ioapic->apic_dev, irq, irq_entry->val);
+ ipi.vector = irq_entry->vec;
+ ipi.mode = irq_entry->del_mode;
+ ipi.logical = irq_entry->dst_mode;
+ ipi.trigger_mode = irq_entry->trig_mode;
+ ipi.dst = irq_entry->dst_field;
+ ipi.dst_shorthand = 0;
+ // Need to add destination argument here...
+ if (v3_apic_send_ipi(vm, ioapic->apic_dev, &ipi) == -1) {
+ PrintError("Error sending IPI to apic %d\n", ipi.dst);
+ return -1;
+ }
}
return 0;