DragonFly-2.3.1.262.g223bf master sys/platform/pc32/i386 mp_mach

看板DFBSD_commit作者時間16年前 (2009/06/14 21:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 223bf214b579c486a04c63795cdf9808b2e87b14 Author: Sepherosa Ziehau <sephe@dragonflybsd.org> Date: Sun Jun 14 19:39:44 2009 +0800 MADT MP probe: Rework cpuid mapping, and cpuid to apicid mapping - Don't use the ACPI ProcessorID as our cpuid, some BIOSes count ProcessorID from 1, and ACPI standards actually allow that. Instead, except for BSP, we set the processor's cpuid in the order that we found the MADT LAPIC entry. - Since MADT does not provide a way to identify the BSP, we will have to do it ourselves: Split the madt_parse() into three parts: o madt_check(), preliminary length and revision check. o madt_pass1(), locate the LAPIC address. o madt_pass2(), set mp_naps and map cpuid to apicid. After madt_pass1(), the lapic is mapped, so we could get the current CPU's apic id. Since the current CPU is BSP, we have the BSP's apic id. In madt_pass2(), we match the MADT LAPIC entry's apic_id field against the the value read from the current CPU's lapic id field. Any matching means that entry contains information concerning BSP. Reported-by: tuxillo on EFnet #dragonflybsd Summary of changes: sys/platform/pc32/i386/mp_machdep.c | 14 ++++- sys/platform/pc32/i386/mp_madt.c | 115 +++++++++++++++++++++++++---------- sys/platform/pc32/include/smp.h | 4 +- 3 files changed, 97 insertions(+), 36 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/223bf214b579c486a04c63795cdf9808b2e87b14 -- DragonFly BSD source repository
文章代碼(AID): #1ADFlN00 (DFBSD_commit)