hv: Variable/macro renaming for intr handling of PT devices using IO-APIC/PIC

1. Renames DEFINE_IOAPIC_SID with DEFINE_INTX_SID as the virtual source can
   be IOAPIC or PIC
2. Rename the src member of source_id.intx_id to ctlr to indicate interrupt
   controller
2. Changes the type of src member of source_id.intx_id from uint32_t to
   enum with INTX_CTLR_IOAPIC and INTX_CTLR_PIC

Tracked-On: #4447
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
This commit is contained in:
Sainath Grandhi
2020-03-02 06:14:19 -08:00
committed by wenlingz
parent 9a79443204
commit 460e7ee5b1
6 changed files with 49 additions and 41 deletions

View File

@@ -333,7 +333,7 @@ static void vioapic_indirect_write(struct acrn_vioapic *vioapic, uint32_t addr,
if ((new.bits.intr_mask == IOAPIC_RTE_MASK_CLR) || (last.bits.intr_mask == IOAPIC_RTE_MASK_CLR)) {
/* VM enable intr */
/* NOTE: only support max 256 pin */
(void)ptirq_intx_pin_remap(vioapic->vm, pin, PTDEV_VPIN_IOAPIC);
(void)ptirq_intx_pin_remap(vioapic->vm, pin, INTX_CTLR_IOAPIC);
}
/*
@@ -420,7 +420,7 @@ vioapic_process_eoi(struct acrn_vm *vm, uint32_t vector)
continue;
}
ptirq_intx_ack(vm, pin, PTDEV_VPIN_IOAPIC);
ptirq_intx_ack(vm, pin, INTX_CTLR_IOAPIC);
}
/*

View File

@@ -342,7 +342,7 @@ static int32_t vpic_ocw1(const struct acrn_vpic *vpic, struct i8259_reg_state *i
virt_pin = (master_pic(vpic, i8259)) ?
pin : (pin + 8U);
(void)ptirq_intx_pin_remap(vpic->vm, virt_pin, PTDEV_VPIN_PIC);
(void)ptirq_intx_pin_remap(vpic->vm, virt_pin, INTX_CTLR_PIC);
}
pin = (pin + 1U) & 0x7U;
}
@@ -379,7 +379,7 @@ static int32_t vpic_ocw2(const struct acrn_vpic *vpic, struct i8259_reg_state *i
/* if level ack PTDEV */
if ((i8259->elc & (1U << (isr_bit & 0x7U))) != 0U) {
ptirq_intx_ack(vpic->vm, (master_pic(vpic, i8259) ? isr_bit : isr_bit + 8U),
PTDEV_VPIN_PIC);
INTX_CTLR_PIC);
}
} else if (((val & OCW2_SL) != 0U) && i8259->rotate) {
/* specific priority */