x86_64: Move CPU ID and APIC ID maps from mp_machdep.c to lapic.c
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 May 2011 14:00:25 +0000 (22:00 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 May 2011 15:37:16 +0000 (23:37 +0800)
sys/platform/pc64/apic/lapic.c
sys/platform/pc64/apic/lapic.h
sys/platform/pc64/include/smp.h
sys/platform/pc64/x86_64/mp_machdep.c

index d2af754..6fc1e25 100644 (file)
@@ -84,6 +84,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];
+
 void
 lapic_eoi(void)
 {
index 3557d5f..ac2494a 100644 (file)
@@ -55,6 +55,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 beb825e..f7464e8 100644 (file)
@@ -70,8 +70,6 @@ extern void (*cpustop_restartfunc) (void);
 extern int                     imcr_present;
 extern int                     apic_io_enable;
 extern int                     mp_naps;
-extern int                     cpu_num_to_apic_id[];
-extern int                     apic_id_to_logical[];
 
 #define APIC_INTMAPSIZE 192
 /*
index 2389dcf..a1e6884 100644 (file)
@@ -145,13 +145,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;