Changeset 163 for trunk/hal/x86_64/core


Ignore:
Timestamp:
Jul 7, 2017, 2:46:34 PM (7 years ago)
Author:
max@…
Message:

handle the LAPIC override, and count the number of CPUs

File:
1 edited

Legend:

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

    r113 r163  
    107107static void hal_acpi_parse_madt(madt_t *madt)
    108108{
     109        madt_lapic_override_t *override;
    109110        void *ptr, *end;
    110111        subheader_t *sub;
     112        size_t ncpu = 0;
    111113
    112114        extern paddr_t lapic_pa;
     
    120122                if (sub->Type == ACPI_MADT_TYPE_IO_APIC) {
    121123                        hal_acpi_parse_ioapic((madt_ioapic_t *)sub);
     124                } else if (sub->Type == ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE) {
     125                        override = (madt_lapic_override_t *)sub;
     126                        lapic_pa = (paddr_t)override->Address;
     127                        x86_printf("-> found LAPIC override\n");
     128                } else if (sub->Type == ACPI_MADT_TYPE_LOCAL_APIC) {
     129                        ncpu++;
    122130                }
    123                 // XXX: handle lapic override
     131
    124132                ptr += sub->Length;
    125133        }
    126134
    127135        x86_printf("-> LAPIC address: %Z\n", lapic_pa);
     136        x86_printf("-> number of CPUs: %z\n", ncpu);
    128137}
    129138
Note: See TracChangeset for help on using the changeset viewer.