x86: refactor ->setup_portio_remap() subarch methods
authorIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 11:43:18 +0000 (12:43 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 22:20:25 +0000 (23:20 +0100)
Only NUMAQ has a real ->setup_portio_remap() method, the other
subarchitectures define it but keep it empty.

So mark the vector as NULL, extend the generic code to handle
NULL -setup_portio_remap() entries and remove all the empty
handlers.

Also move the NUMAQ method from the header file into the
 apic driver .c file.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 files changed:
arch/x86/include/asm/bigsmp/apic.h
arch/x86/include/asm/es7000/apic.h
arch/x86/include/asm/mach-default/mach_apic.h
arch/x86/include/asm/mach-generic/mach_apic.h
arch/x86/include/asm/numaq/apic.h
arch/x86/include/asm/summit/apic.h
arch/x86/kernel/smpboot.c
arch/x86/mach-generic/bigsmp.c
arch/x86/mach-generic/default.c
arch/x86/mach-generic/es7000.c
arch/x86/mach-generic/numaq.c
arch/x86/mach-generic/summit.c

index 080457450b22129fec4f242491f5c7625bd99dc4..2fa70032e3b444b112178b7a45e9a69cd0a5768d 100644 (file)
@@ -95,7 +95,7 @@ static inline physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map)
        return physids_promote(0xFFL);
 }
 
-static inline void setup_portio_remap(void)
+static inline void bigsmp_setup_portio_remap(void)
 {
 }
 
index a09e1133ced9a6b1e5a1afff6fd291ffc82b07e9..c5b0eb51e53a468d786a3e786ab32e65500c0631 100644 (file)
@@ -127,10 +127,6 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
 }
 
 
-static inline void setup_portio_remap(void)
-{
-}
-
 extern unsigned int boot_cpu_physical_apicid;
 static inline int check_phys_apicid_present(int cpu_physical_apicid)
 {
index 22683e5b82be1e8c4dcbf50335e85d4a4158b2cc..54c20e19e2803176068297b2c0d8118866a72db5 100644 (file)
@@ -132,10 +132,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
        return physid_mask_of_physid(phys_apicid);
 }
 
-static inline void setup_portio_remap(void)
-{
-}
-
 static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
 {
        return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
index 997618f2eb5c357b125cbadd3b00527bb7298f71..393a97c5685f7f72f51348dadab33a903bbefeec 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <asm/genapic.h>
 
-#define setup_portio_remap (apic->setup_portio_remap)
 #define check_phys_apicid_present (apic->check_phys_apicid_present)
 #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
 #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
index 8ac000f9928565f476573b918fe81940f32c0ee5..6b626519cd75239ff22575b1fc163df97c35b00a 100644 (file)
@@ -92,19 +92,6 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)
 
 extern void *xquad_portio;
 
-static inline void setup_portio_remap(void)
-{
-       int num_quads = num_online_nodes();
-
-       if (num_quads <= 1)
-                       return;
-
-       printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
-       xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
-       printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
-               (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
-}
-
 static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
 {
        return (1);
index 79c1a45f886b8351451a3d6c99943abb5d4294ff..131343b0b757dc1499a6ed0bf4ae6739e09245c5 100644 (file)
@@ -116,7 +116,7 @@ static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)
        return physid_mask_of_physid(0);
 }
 
-static inline void setup_portio_remap(void)
+static inline void summit_setup_portio_remap(void)
 {
 }
 
index 812bf39de35522d048d8c43a2ed2e91b3f428a2c..0e7d26c01f9f4530355c15a121eab10315b07294 100644 (file)
@@ -1170,7 +1170,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 
        map_cpu_to_logical_apicid();
 
-       setup_portio_remap();
+       if (apic->setup_portio_remap)
+               apic->setup_portio_remap();
 
        smpboot_setup_io_apic();
        /*
index 6139652307449f64b7354cccff44e4aa9df01230..424740554a32ca8b0685adf32db224ba2a5b6b10 100644 (file)
@@ -84,7 +84,7 @@ struct genapic apic_bigsmp = {
        .cpu_to_logical_apicid          = bigsmp_cpu_to_logical_apicid,
        .cpu_present_to_apicid          = bigsmp_cpu_present_to_apicid,
        .apicid_to_cpu_present          = bigsmp_apicid_to_cpu_present,
-       .setup_portio_remap             = setup_portio_remap,
+       .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = check_phys_apicid_present,
        .enable_apic_mode               = enable_apic_mode,
        .phys_pkg_id                    = phys_pkg_id,
index 8fc704a3db7cc6f6bcd020ef3666c5a80cc7e4f4..b48a58daf7190d5eaf23adcfc0f2043c40c6fb6a 100644 (file)
@@ -65,7 +65,7 @@ struct genapic apic_default = {
        .cpu_to_logical_apicid          = default_cpu_to_logical_apicid,
        .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .apicid_to_cpu_present          = default_apicid_to_cpu_present,
-       .setup_portio_remap             = setup_portio_remap,
+       .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = check_phys_apicid_present,
        .enable_apic_mode               = enable_apic_mode,
        .phys_pkg_id                    = phys_pkg_id,
index 1e0e1627455715fee7438a6fe926c52f18fcf78c..449eca5b6048908bcb56492ce550cce2c5abcf80 100644 (file)
@@ -126,7 +126,7 @@ struct genapic apic_es7000 = {
        .cpu_to_logical_apicid          = es7000_cpu_to_logical_apicid,
        .cpu_present_to_apicid          = es7000_cpu_present_to_apicid,
        .apicid_to_cpu_present          = es7000_apicid_to_cpu_present,
-       .setup_portio_remap             = setup_portio_remap,
+       .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = check_phys_apicid_present,
        .enable_apic_mode               = enable_apic_mode,
        .phys_pkg_id                    = phys_pkg_id,
index 839b86b765a12444d4d11ee1d60e25631f541f16..e60361b0bf1ed7c027d737e7f4cce2761409649c 100644 (file)
@@ -44,6 +44,19 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
        *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
 }
 
+static void numaq_setup_portio_remap(void)
+{
+       int num_quads = num_online_nodes();
+
+       if (num_quads <= 1)
+                       return;
+
+       printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
+       xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
+       printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
+               (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
+}
+
 struct genapic apic_numaq = {
 
        .name                           = "NUMAQ",
@@ -71,7 +84,7 @@ struct genapic apic_numaq = {
        .cpu_to_logical_apicid          = numaq_cpu_to_logical_apicid,
        .cpu_present_to_apicid          = numaq_cpu_present_to_apicid,
        .apicid_to_cpu_present          = numaq_apicid_to_cpu_present,
-       .setup_portio_remap             = setup_portio_remap,
+       .setup_portio_remap             = numaq_setup_portio_remap,
        .check_phys_apicid_present      = check_phys_apicid_present,
        .enable_apic_mode               = enable_apic_mode,
        .phys_pkg_id                    = phys_pkg_id,
index b6e37607a523d54b62dee7973202c8f4d3ee9885..ffcf7ca2e8ce878f3b7bc227ebb1f13576f33ae3 100644 (file)
@@ -64,7 +64,7 @@ struct genapic apic_summit = {
        .cpu_to_logical_apicid          = summit_cpu_to_logical_apicid,
        .cpu_present_to_apicid          = summit_cpu_present_to_apicid,
        .apicid_to_cpu_present          = summit_apicid_to_cpu_present,
-       .setup_portio_remap             = setup_portio_remap,
+       .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = check_phys_apicid_present,
        .enable_apic_mode               = enable_apic_mode,
        .phys_pkg_id                    = phys_pkg_id,