summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/acpi.c8
-rw-r--r--src/arch/x86/include/arch/acpi.h33
2 files changed, 20 insertions, 21 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index e28da5393c..2f793b4cb2 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -127,7 +127,7 @@ int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base,
int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic)
{
- lapic->type = 0; /* Local APIC structure */
+ lapic->type = LOCAL_APIC; /* Local APIC structure */
lapic->length = sizeof(acpi_madt_lapic_t);
lapic->flags = (1 << 0); /* Processor/LAPIC enabled */
lapic->processor_id = cpu;
@@ -165,7 +165,7 @@ unsigned long acpi_create_madt_lapics(unsigned long current)
int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr,
u32 gsi_base)
{
- ioapic->type = 1; /* I/O APIC structure */
+ ioapic->type = IO_APIC; /* I/O APIC structure */
ioapic->length = sizeof(acpi_madt_ioapic_t);
ioapic->reserved = 0x00;
ioapic->gsi_base = gsi_base;
@@ -178,7 +178,7 @@ int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr,
int acpi_create_madt_irqoverride(acpi_madt_irqoverride_t *irqoverride,
u8 bus, u8 source, u32 gsirq, u16 flags)
{
- irqoverride->type = 2; /* Interrupt source override */
+ irqoverride->type = IRQ_SOURCE_OVERRIDE; /* Interrupt source override */
irqoverride->length = sizeof(acpi_madt_irqoverride_t);
irqoverride->bus = bus;
irqoverride->source = source;
@@ -191,7 +191,7 @@ int acpi_create_madt_irqoverride(acpi_madt_irqoverride_t *irqoverride,
int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu,
u16 flags, u8 lint)
{
- lapic_nmi->type = 4; /* Local APIC NMI structure */
+ lapic_nmi->type = LOCAL_APIC_NMI; /* Local APIC NMI structure */
lapic_nmi->length = sizeof(acpi_madt_lapic_nmi_t);
lapic_nmi->flags = flags;
lapic_nmi->processor_id = cpu;
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 9d5299531f..20c244cc1e 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -390,24 +390,23 @@ typedef struct acpi_dmar {
} __packed acpi_dmar_t;
/* MADT: APIC Structure Types */
-/* TODO: Convert to ALLCAPS. */
enum acpi_apic_types {
- LocalApic = 0, /* Processor local APIC */
- IOApic = 1, /* I/O APIC */
- IRQSourceOverride = 2, /* Interrupt source override */
- NMIType = 3, /* NMI source */
- LocalApicNMI = 4, /* Local APIC NMI */
- LApicAddressOverride = 5, /* Local APIC address override */
- IOSApic = 6, /* I/O SAPIC */
- LocalSApic = 7, /* Local SAPIC */
- PlatformIRQSources = 8, /* Platform interrupt sources */
- Localx2Apic = 9, /* Processor local x2APIC */
- Localx2ApicNMI = 10, /* Local x2APIC NMI */
- GICC = 11, /* GIC CPU Interface */
- GICD = 12, /* GIC Distributor */
- GIC_MSI_FRAME = 13, /* GIC MSI Frame */
- GICR = 14, /* GIC Redistributor */
- GIC_ITS = 15, /* Interrupt Translation Service */
+ LOCAL_APIC, /* Processor local APIC */
+ IO_APIC, /* I/O APIC */
+ IRQ_SOURCE_OVERRIDE, /* Interrupt source override */
+ NMI_TYPE, /* NMI source */
+ LOCAL_APIC_NMI, /* Local APIC NMI */
+ LAPIC_ADDRESS_OVERRIDE, /* Local APIC address override */
+ IO_SAPIC, /* I/O SAPIC */
+ LOCAL_SAPIC, /* Local SAPIC */
+ PLATFORM_IRQ_SOURCES, /* Platform interrupt sources */
+ LOCAL_X2APIC, /* Processor local x2APIC */
+ LOCAL_X2APIC_NMI, /* Local x2APIC NMI */
+ GICC, /* GIC CPU Interface */
+ GICD, /* GIC Distributor */
+ GIC_MSI_FRAME, /* GIC MSI Frame */
+ GICR, /* GIC Redistributor */
+ GIC_ITS, /* Interrupt Translation Service */
/* 0x10-0x7f: Reserved */
/* 0x80-0xff: Reserved for OEM use */
};