Introduce lapic enumerators, which is used to probe and config lapics
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 27 Jun 2009 01:36:42 +0000 (09:36 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 27 Jun 2009 03:53:20 +0000 (11:53 +0800)
commit281d9482759bb075834585452a405a8c9bdf18e7
treee1dab005b93a67e2bae96c6096c1f6beef035677
parentad52b37b474bc10af16b0d4b42465282a5a3f432
Introduce lapic enumerators, which is used to probe and config lapics

lapic enumerator implementation should provide two method:
lapic_probe()     -- make sure that if this enumerator is selected, later
                     lapic enumeration could work.  Return error code upon
                     failure.
lapic_enumerate() -- enumerate lapic and properly configure lapic (currently
                     only mapping lapic is needed).

lapic enumerator implementation could be registered by calling:
lapic_enumerator_register()
with lapic_enumerator struct.  The higher the priority field, the earlier
the lapic enumerator's lapic_probe method will be invoked.

Currently two lapic enumerators are implemented and registered:
- lapic enumerator using MP table
- lapic enumerator using ACPI MADT
ACPI MADT lapic enumerator has higher priority.  For testing purpose, ACPI
MADT lapic enumerator's priority could be overridden by setting tunable
hw.madt_lapic_prio to a smaller value (less than 20 currently)

Idea-from: FreeBSD
sys/platform/pc32/apic/mpapic.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/mp_madt.c
sys/platform/pc32/include/smp.h