diff options
author | marcel <marcel@FreeBSD.org> | 2003-01-05 22:14:30 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-01-05 22:14:30 +0000 |
commit | d16b835650e0e0df5195fb36fc746a92ec47967f (patch) | |
tree | 6ec6b64be486fd3597078403561bc5e7fdbe7bbb /sys/ia64/acpica | |
parent | e40f9005a341203137672200c2e4e89126204897 (diff) | |
download | FreeBSD-src-d16b835650e0e0df5195fb36fc746a92ec47967f.zip FreeBSD-src-d16b835650e0e0df5195fb36fc746a92ec47967f.tar.gz |
Don't hardcode the address of the local (S)APIC (aka processor
interrupt block). We use the previously hardcoded address as a
default only, but will otherwise use whatever ACPI tells us.
The address can be found in the MADT table header or in the
LAPIC override table entry.
Diffstat (limited to 'sys/ia64/acpica')
-rw-r--r-- | sys/ia64/acpica/madt.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/ia64/acpica/madt.c b/sys/ia64/acpica/madt.c index 50169da..b210633 100644 --- a/sys/ia64/acpica/madt.c +++ b/sys/ia64/acpica/madt.c @@ -30,6 +30,8 @@ #include <machine/cpu.h> +extern u_int64_t ia64_lapic_address; + struct sapic *sapic_create(int, int, u_int64_t); #pragma pack(1) @@ -71,6 +73,13 @@ typedef struct /* LOCAL SAPIC */ UINT32 FlagsReserved: 31; } LOCAL_SAPIC; +typedef struct /* LOCAL APIC OVERRIDE */ +{ + APIC_HEADER Header; + UINT16 Reserved; + UINT64 LocalApicAddress; +} LAPIC_OVERRIDE; + typedef struct /* PLATFORM INTERRUPT SOURCE */ { APIC_HEADER Header; @@ -123,6 +132,15 @@ parse_local_sapic(LOCAL_SAPIC *sapic) } static void +parse_lapic_override(LAPIC_OVERRIDE *lapic) +{ + if (bootverbose) + printf("\t\tLocal APIC address=0x%lx\n", + lapic->LocalApicAddress); + ia64_lapic_address = lapic->LocalApicAddress; +} + +static void parse_platform_interrupt(PLATFORM_INTERRUPT_SOURCE *source) { if (bootverbose) @@ -163,6 +181,12 @@ parse_madt(APIC_TABLE *madt, int countcpus) return (cpus); } + /* Save the address of the processor interrupt block. */ + if (bootverbose) + printf("\tLocal APIC address=0x%x\n", + madt->LocalApicAddress); + ia64_lapic_address = madt->LocalApicAddress; + for (p = (char *)(madt + 1); p < end; ) { APIC_HEADER *head = (APIC_HEADER *)p; @@ -201,6 +225,7 @@ parse_madt(APIC_TABLE *madt, int countcpus) case APIC_LOCAL_APIC_OVERRIDE: if (bootverbose) printf("Local APIC override entry\n"); + parse_lapic_override((LAPIC_OVERRIDE*)head); break; case APIC_IO_SAPIC: |