i386: Move CPU ID and APIC ID maps from mp_machdep.c to lapic.c
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 5 May 2011 11:21:53 +0000 (19:21 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 13 May 2011 02:17:27 +0000 (10:17 +0800)
sys/platform/pc32/apic/lapic.c
sys/platform/pc32/apic/lapic.h
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/include/smp.h

index c6a9129..686ff53 100644 (file)
@@ -83,6 +83,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.
  */
 void
index 28c08b2..ad39841 100644 (file)
@@ -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);
index c854cff..be08007 100644 (file)
@@ -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;
index 77acde8..1740f8d 100644 (file)
@@ -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
 /*