From: Sepherosa Ziehau Date: Thu, 5 May 2011 11:21:53 +0000 (+0800) Subject: i386: Move CPU ID and APIC ID maps from mp_machdep.c to lapic.c X-Git-Tag: v2.12.0~638 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/68d62ec363526f409342737a27991767883b4286 i386: Move CPU ID and APIC ID maps from mp_machdep.c to lapic.c --- diff --git a/sys/platform/pc32/apic/lapic.c b/sys/platform/pc32/apic/lapic.c index c6a91292ec..686ff53024 100644 --- a/sys/platform/pc32/apic/lapic.c +++ b/sys/platform/pc32/apic/lapic.c @@ -82,6 +82,13 @@ static const uint32_t lapic_timer_divisors[] = { }; #define APIC_TIMER_NDIVISORS (int)(NELEM(lapic_timer_divisors)) +/* + * APIC ID logical/physical mapping structures. + * We oversize these to simplify boot-time config. + */ +int cpu_num_to_apic_id[NAPICID]; +int apic_id_to_logical[NAPICID]; + /* * Enable LAPIC, configure interrupts. */ diff --git a/sys/platform/pc32/apic/lapic.h b/sys/platform/pc32/apic/lapic.h index 28c08b2c70..ad39841e60 100644 --- a/sys/platform/pc32/apic/lapic.h +++ b/sys/platform/pc32/apic/lapic.h @@ -54,6 +54,8 @@ struct lapic_enumerator { #ifdef SMP extern volatile lapic_t *lapic; +extern int cpu_num_to_apic_id[]; +extern int apic_id_to_logical[]; void apic_dump(char*); void lapic_init(boolean_t); diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index c854cff7fa..be08007ac0 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -147,13 +147,6 @@ extern int64_t tsc_offsets[]; struct apic_intmapinfo int_to_apicintpin[APIC_INTMAPSIZE]; #endif -/* - * APIC ID logical/physical mapping structures. - * We oversize these to simplify boot-time config. - */ -int cpu_num_to_apic_id[NAPICID]; -int apic_id_to_logical[NAPICID]; - /* AP uses this during bootstrap. Do not staticize. */ char *bootSTK; static int bootAP; diff --git a/sys/platform/pc32/include/smp.h b/sys/platform/pc32/include/smp.h index 77acde88ac..1740f8d9b0 100644 --- a/sys/platform/pc32/include/smp.h +++ b/sys/platform/pc32/include/smp.h @@ -60,8 +60,6 @@ extern void (*cpustop_restartfunc) (void); /* global data in mp_machdep.c */ extern int imcr_present; extern int mp_naps; -extern int cpu_num_to_apic_id[]; -extern int apic_id_to_logical[]; #define APIC_INTMAPSIZE 192 /*