break;
default: {
uint_t redir_index = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) >> 1;
- uint_t hi_val = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) % 1;
+ uint_t hi_val = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) & 1;
if (redir_index > 0x3f) {
PrintError("ioapic %u: Invalid redirection table entry %x\n", ioapic->ioapic_id.id, (uint32_t)redir_index);
PrintDebug("ioapic %u: IOAPIC Write at %p (val = %d)\n", ioapic->ioapic_id.id, (void *)guest_addr, *(uint32_t *)src);
if (reg_tgt == 0x00) {
+ PrintDebug("ioapic %u: Setting ioapic index register to 0x%x.\n", ioapic->ioapic_id.id, op_val);
ioapic->index_reg = op_val;
} else if (reg_tgt == 0x10) {
// IOWIN register
default:
{
uint_t redir_index = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) >> 1;
- uint_t hi_val = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) % 1;
-
-
+ uint_t hi_val = (ioapic->index_reg - IOAPIC_REDIR_BASE_REG) & 1;
+ PrintDebug("ioapic %u: Writing value 0x%x to redirection entry %u (%s)\n",
+ ioapic->ioapic_id.id, op_val, redir_index, hi_val ? "hi" : "low");
if (redir_index > 0x3f) {
PrintError("ioapic %u: Invalid redirection table entry %x\n", ioapic->ioapic_id.id, (uint32_t)redir_index);
icr.dst_shorthand=0; // no shorthand
icr.rsvd2=0;
- // Note: 0 yhere is "cluster model", but it should be irrelevant
- // since we are sending this as a physical destination
PrintDebug("io apic %u: raising irq %u on ICC bus.\n",
ioapic->ioapic_id.id, irq);
- v3_icc_send_ipi(ioapic->icc_bus, ioapic->ioapic_id.id,icr.val, 0, irq);
+ v3_icc_send_ipi(ioapic->icc_bus, ioapic->ioapic_id.id,icr.val, irq);
}
return 0;