hv: Enumerate IOAPIC info from MADT

IOAPIC info, specifically ID, is needed to map the IOAPIC to
corresponding DMAR. DMAR table in ACPI has a field that has IOAPIC
ID, that matches the info provided in MADT. Both (IOAPIC info from
MADT and from DMAR) is needed for remapping IOAPIC interrupts.

Tracked-On: #2426
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Grandhi, Sainath
2019-01-26 00:04:47 -08:00
committed by Eddie Dong
parent fb6e9267f3
commit 4ff9f5dfb2
8 changed files with 101 additions and 11 deletions

View File

@@ -16,6 +16,7 @@
#include <io.h>
#include <io_req.h>
#include <io_emul.h>
#include <ioapic.h>
#include <vmtrr.h>
#include <timer.h>
#include <vlapic.h>

View File

@@ -9,10 +9,18 @@
#define NR_LEGACY_IRQ 16U
#define NR_LEGACY_PIN NR_LEGACY_IRQ
struct ioapic_info {
uint8_t id;
uint32_t addr;
uint32_t gsi_base;
};
void ioapic_setup_irqs(void);
bool ioapic_irq_is_gsi(uint32_t irq);
uint32_t ioapic_irq_to_pin(uint32_t irq);
int32_t init_ioapic_id_info(void);
/**
* @brief Get irq num from pin num