mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
HV: refine APIC base address to platform acpi info
The base address of LAPIC and IOAPIC should be parsed from MADT table, so move the definition to platform_acpi_info.h. Tracked-On: #1500 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -122,25 +122,18 @@ ioapic_write_reg32(const void *ioapic_base,
|
||||
spinlock_irqrestore_release(&ioapic_lock, rflags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre apic_id < 2
|
||||
*/
|
||||
static inline uint64_t
|
||||
get_ioapic_base(uint8_t apic_id)
|
||||
{
|
||||
uint64_t addr = 0xffffffffffffffffUL;
|
||||
const uint64_t addr[2] = {IOAPIC0_BASE, IOAPIC1_BASE};
|
||||
|
||||
/* should extract next ioapic from ACPI MADT table */
|
||||
if (apic_id == 0U) {
|
||||
addr = DEFAULT_IO_APIC_BASE;
|
||||
} else if (apic_id == 1U) {
|
||||
addr = 0xfec3f000UL;
|
||||
} else if (apic_id == 2U) {
|
||||
addr = 0xfec7f000UL;
|
||||
} else {
|
||||
ASSERT(apic_id <= 2U, "ACPI MADT table missing");
|
||||
}
|
||||
return addr;
|
||||
/* the ioapic base should be extracted from ACPI MADT table */
|
||||
return addr[apic_id];
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
ioapic_get_rte_entry(void *ioapic_addr,
|
||||
uint8_t pin, union ioapic_rte *rte)
|
||||
|
Reference in New Issue
Block a user