Ignore:
Timestamp:
Jun 29, 2017, 9:54:01 AM (5 years ago)
Author:
max@…
Message:

Parse the IOAPIC structure in ACPI, map the IOAPIC, and enable
the keyboard interrupt. Its queue is not flushed yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_acpi.c

    r51 r89  
    109109/* -------------------------------------------------------------------------- */
    110110
     111static void hal_acpi_parse_ioapic(madt_ioapic_t *ioapic)
     112{
     113        extern paddr_t ioapic_pa;
     114        ioapic_pa = ioapic->Address;
     115        x86_printf("-> IOAPIC address: %Z\n", ioapic_pa);
     116}
     117
    111118static void hal_acpi_parse_madt(madt_t *madt)
    112119{
     120        void *ptr, *end;
     121        subheader_t *sub;
     122
    113123        extern paddr_t lapic_pa;
    114124        lapic_pa = (paddr_t)madt->Address;
     125
     126        ptr = (void *)(madt + 1);
     127        end = (void *)madt + madt->Header.Length;
     128
     129        while (ptr < end) {
     130                sub = (subheader_t *)ptr;
     131                if (sub->Type == ACPI_MADT_TYPE_IO_APIC) {
     132                        hal_acpi_parse_ioapic((madt_ioapic_t *)sub);
     133                }
     134                // XXX: handle lapic override
     135                ptr += sub->Length;
     136        }
     137
    115138        x86_printf("-> LAPIC address: %Z\n", lapic_pa);
    116139}
Note: See TracChangeset for help on using the changeset viewer.