x86, apic: Make apic drivers static
authorSuresh Siddha <suresh.b.siddha@intel.com>
Sat, 21 May 2011 00:51:20 +0000 (17:51 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 22 May 2011 09:48:04 +0000 (11:48 +0200)
Apic probe now looks at the apic drivers listed in the
.apicdrivers section. Remove apic_probe[] and make each apic
driver static.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: steiner@sgi.com
Cc: gorcunov@openvz.org
Cc: yinghai@kernel.org
Link: http://lkml.kernel.org/r/20110521005526.341718626@sbsiddha-MOBL3.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/es7000_32.c
arch/x86/kernel/apic/numaq_32.c
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/probe_64.c
arch/x86/kernel/apic/summit_32.c
arch/x86/kernel/apic/x2apic_cluster.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c

index f37703dc69feb43f68f9c203e0c3fe83122a1abf..4a0b7c7e2cce5c430a95f6f972c7e810c379170f 100644 (file)
@@ -478,15 +478,10 @@ static inline unsigned default_get_apic_id(unsigned long x)
 #define DEFAULT_TRAMPOLINE_PHYS_HIGH           0x469
 
 #ifdef CONFIG_X86_64
-extern struct apic apic_flat;
-extern struct apic apic_physflat;
-extern struct apic apic_x2apic_cluster;
-extern struct apic apic_x2apic_phys;
 extern int default_acpi_madt_oem_check(char *, char *);
 
 extern void apic_send_IPI_self(int vector);
 
-extern struct apic apic_x2apic_uv_x;
 DECLARE_PER_CPU(int, x2apic_extra_bits);
 
 extern int default_cpu_present_to_apicid(int mps_cpu);
@@ -536,8 +531,6 @@ extern struct apic apic_noop;
 
 #ifdef CONFIG_X86_32
 
-extern struct apic apic_default;
-
 static inline int noop_x86_32_early_logical_apicid(int cpu)
 {
        return BAD_APICID;
index 6ce0f7f08c5712f8b6a4fdd39dcbaa66639c642d..9570ee55e402ff4c45948c5bb275d03ad531cd95 100644 (file)
 #include <acpi/acpi_bus.h>
 #endif
 
+static struct apic apic_physflat;
+static struct apic apic_flat;
+
+struct apic __read_mostly *apic = &apic_flat;
+EXPORT_SYMBOL_GPL(apic);
+
 static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
        return 1;
@@ -164,7 +170,7 @@ static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
        return initial_apic_id >> index_msb;
 }
 
-struct apic apic_flat =  {
+static struct apic apic_flat =  {
        .name                           = "flat",
        .probe                          = NULL,
        .acpi_madt_oem_check            = flat_acpi_madt_oem_check,
@@ -320,7 +326,7 @@ static int physflat_probe(void)
        return 0;
 }
 
-struct apic apic_physflat =  {
+static struct apic apic_physflat =  {
 
        .name                           = "physical flat",
        .probe                          = physflat_probe,
index 479a06c233d0db077a5fa93c9455959d5eb02d3d..efd737e827f45b72c86c34643700e89caab6e7b6 100644 (file)
@@ -193,7 +193,7 @@ static int probe_bigsmp(void)
        return dmi_bigsmp;
 }
 
-struct apic apic_bigsmp = {
+static struct apic apic_bigsmp = {
 
        .name                           = "bigsmp",
        .probe                          = probe_bigsmp,
index 80de0d78cbcac854b1feb5c30a1ee30e6559efdc..9536b3fe43f840bd8aa084de61413ebc3504193b 100644 (file)
@@ -620,7 +620,7 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
 }
 
 /* We've been warned by a false positive warning.Use __refdata to keep calm. */
-struct apic __refdata apic_es7000_cluster = {
+static struct apic __refdata apic_es7000_cluster = {
 
        .name                           = "es7000",
        .probe                          = probe_es7000,
@@ -685,7 +685,7 @@ struct apic __refdata apic_es7000_cluster = {
        .x86_32_early_logical_apicid    = es7000_early_logical_apicid,
 };
 
-struct apic __refdata apic_es7000 = {
+static struct apic __refdata apic_es7000 = {
 
        .name                           = "es7000",
        .probe                          = probe_es7000,
index 4caab0d13d990ee69a34cf80c24aa10ac74eaf16..c4a61ca1349a5ce4b1e00d8bbcb326e7bd1203e2 100644 (file)
@@ -472,8 +472,8 @@ static void numaq_setup_portio_remap(void)
                (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
 }
 
-/* Use __refdata to keep false positive warning calm.  */
-struct apic __refdata apic_numaq = {
+/* Use __refdata to keep false positive warning calm.  */
+static struct apic __refdata apic_numaq = {
 
        .name                           = "NUMAQ",
        .probe                          = probe_numaq,
index c81756d8d4ec28db7a10d31745eb51b2a8792734..b5254ad044abdacd5d96a5d97eb2f87a0b8f0981 100644 (file)
@@ -87,7 +87,7 @@ static int probe_default(void)
        return 1;
 }
 
-struct apic apic_default = {
+static struct apic apic_default = {
 
        .name                           = "default",
        .probe                          = probe_default,
@@ -151,33 +151,9 @@ struct apic apic_default = {
 
 apic_driver(apic_default);
 
-extern struct apic apic_numaq;
-extern struct apic apic_summit;
-extern struct apic apic_bigsmp;
-extern struct apic apic_es7000;
-extern struct apic apic_es7000_cluster;
-
 struct apic *apic = &apic_default;
 EXPORT_SYMBOL_GPL(apic);
 
-static struct apic *apic_probe[] __initdata = {
-#ifdef CONFIG_X86_NUMAQ
-       &apic_numaq,
-#endif
-#ifdef CONFIG_X86_SUMMIT
-       &apic_summit,
-#endif
-#ifdef CONFIG_X86_BIGSMP
-       &apic_bigsmp,
-#endif
-#ifdef CONFIG_X86_ES7000
-       &apic_es7000,
-       &apic_es7000_cluster,
-#endif
-       &apic_default,  /* must be last */
-       NULL,
-};
-
 static int cmdline_apic __initdata;
 static int __init parse_apic(char *arg)
 {
index e2c361d0fb96e3d28bc8dd42e6ca0c7d03d355ef..3fe98669892905c48d3b8eea6ee11bda7100e75d 100644 (file)
 #include <asm/ipi.h>
 #include <asm/setup.h>
 
-extern struct apic apic_flat;
-extern struct apic apic_physflat;
-extern struct apic apic_x2xpic_uv_x;
-extern struct apic apic_x2apic_phys;
-extern struct apic apic_x2apic_cluster;
-
-struct apic __read_mostly *apic = &apic_flat;
-EXPORT_SYMBOL_GPL(apic);
-
-static struct apic *apic_probe[] __initdata = {
-#ifdef CONFIG_X86_UV
-       &apic_x2apic_uv_x,
-#endif
-#ifdef CONFIG_X86_X2APIC
-       &apic_x2apic_phys,
-       &apic_x2apic_cluster,
-#endif
-       &apic_physflat,
-       NULL,
-};
-
 static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
 {
        return hard_smp_processor_id() >> index_msb;
index 447ec0fa9aa12b40f69dd0ee48f20fae3ef2122b..19114423c58ccee6ba19d5b033c072013e51903d 100644 (file)
@@ -491,7 +491,7 @@ void setup_summit(void)
 }
 #endif
 
-struct apic apic_summit = {
+static struct apic apic_summit = {
 
        .name                           = "summit",
        .probe                          = probe_summit,
index 7595c5775a548063638d796ae9119794dc718487..5007958758273fab8e8fbe32d5de364e495ed286 100644 (file)
@@ -208,7 +208,7 @@ static int x2apic_cluster_probe(void)
                return 0;
 }
 
-struct apic apic_x2apic_cluster = {
+static struct apic apic_x2apic_cluster = {
 
        .name                           = "cluster x2apic",
        .probe                          = x2apic_cluster_probe,
index f7ba21cb3e25649a775229171a226d82a9aa3849..f5373dfde21e277cfd033a11dd8c7bcad306c407 100644 (file)
@@ -11,6 +11,8 @@
 
 int x2apic_phys;
 
+static struct apic apic_x2apic_phys;
+
 static int set_x2apic_phys_mode(char *arg)
 {
        x2apic_phys = 1;
@@ -112,7 +114,7 @@ static int x2apic_phys_probe(void)
        return apic == &apic_x2apic_phys;
 }
 
-struct apic apic_x2apic_phys = {
+static struct apic apic_x2apic_phys = {
 
        .name                           = "physical x2apic",
        .probe                          = x2apic_phys_probe,
index b6c629838f0080dea6a640e901df74868fdc3459..f450b683dfcf4672f87669877f4de6ad7cb596bc 100644 (file)
@@ -58,6 +58,8 @@ unsigned int uv_apicid_hibits;
 EXPORT_SYMBOL_GPL(uv_apicid_hibits);
 static DEFINE_SPINLOCK(uv_nmi_lock);
 
+static struct apic apic_x2apic_uv_x;
+
 static unsigned long __init uv_early_read_mmr(unsigned long addr)
 {
        unsigned long val, *mmr;
@@ -331,7 +333,7 @@ static int uv_probe(void)
        return apic == &apic_x2apic_uv_x;
 }
 
-struct apic __refdata apic_x2apic_uv_x = {
+static struct apic __refdata apic_x2apic_uv_x = {
 
        .name                           = "UV large system",
        .probe                          = uv_probe,