diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 06:43:18 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:25 -0500 |
commit | d83093b50416f4ca59d3a84b2ddc217748214d64 (patch) | |
tree | 7dd0bb6c29ceff7f37941eace690ac157b58338f /arch/x86 | |
parent | 8058714a41afc4c983acb274b1adf7bd3cfe7f6e (diff) |
x86: refactor ->setup_portio_remap() subarch methods
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/bigsmp/apic.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/es7000/apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_apic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/apic.h | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/apic.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 3 | ||||
-rw-r--r-- | arch/x86/mach-generic/bigsmp.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/default.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/es7000.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-generic/numaq.c | 15 | ||||
-rw-r--r-- | arch/x86/mach-generic/summit.c | 2 |
12 files changed, 22 insertions, 30 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h index 080457450b22..2fa70032e3b4 100644 --- a/arch/x86/include/asm/bigsmp/apic.h +++ b/arch/x86/include/asm/bigsmp/apic.h | |||
@@ -95,7 +95,7 @@ static inline physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map) | |||
95 | return physids_promote(0xFFL); | 95 | return physids_promote(0xFFL); |
96 | } | 96 | } |
97 | 97 | ||
98 | static inline void setup_portio_remap(void) | 98 | static inline void bigsmp_setup_portio_remap(void) |
99 | { | 99 | { |
100 | } | 100 | } |
101 | 101 | ||
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h index a09e1133ced9..c5b0eb51e53a 100644 --- a/arch/x86/include/asm/es7000/apic.h +++ b/arch/x86/include/asm/es7000/apic.h | |||
@@ -127,10 +127,6 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
130 | static inline void setup_portio_remap(void) | ||
131 | { | ||
132 | } | ||
133 | |||
134 | extern unsigned int boot_cpu_physical_apicid; | 130 | extern unsigned int boot_cpu_physical_apicid; |
135 | static inline int check_phys_apicid_present(int cpu_physical_apicid) | 131 | static inline int check_phys_apicid_present(int cpu_physical_apicid) |
136 | { | 132 | { |
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index 22683e5b82be..54c20e19e280 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -132,10 +132,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) | |||
132 | return physid_mask_of_physid(phys_apicid); | 132 | return physid_mask_of_physid(phys_apicid); |
133 | } | 133 | } |
134 | 134 | ||
135 | static inline void setup_portio_remap(void) | ||
136 | { | ||
137 | } | ||
138 | |||
139 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 135 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) |
140 | { | 136 | { |
141 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); | 137 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); |
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h index 997618f2eb5c..393a97c5685f 100644 --- a/arch/x86/include/asm/mach-generic/mach_apic.h +++ b/arch/x86/include/asm/mach-generic/mach_apic.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/genapic.h> | 4 | #include <asm/genapic.h> |
5 | 5 | ||
6 | #define setup_portio_remap (apic->setup_portio_remap) | ||
7 | #define check_phys_apicid_present (apic->check_phys_apicid_present) | 6 | #define check_phys_apicid_present (apic->check_phys_apicid_present) |
8 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) | 7 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) |
9 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) | 8 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) |
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h index 8ac000f99285..6b626519cd75 100644 --- a/arch/x86/include/asm/numaq/apic.h +++ b/arch/x86/include/asm/numaq/apic.h | |||
@@ -92,19 +92,6 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid) | |||
92 | 92 | ||
93 | extern void *xquad_portio; | 93 | extern void *xquad_portio; |
94 | 94 | ||
95 | static inline void setup_portio_remap(void) | ||
96 | { | ||
97 | int num_quads = num_online_nodes(); | ||
98 | |||
99 | if (num_quads <= 1) | ||
100 | return; | ||
101 | |||
102 | printk("Remapping cross-quad port I/O for %d quads\n", num_quads); | ||
103 | xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD); | ||
104 | printk("xquad_portio vaddr 0x%08lx, len %08lx\n", | ||
105 | (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); | ||
106 | } | ||
107 | |||
108 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 95 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) |
109 | { | 96 | { |
110 | return (1); | 97 | return (1); |
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h index 79c1a45f886b..131343b0b757 100644 --- a/arch/x86/include/asm/summit/apic.h +++ b/arch/x86/include/asm/summit/apic.h | |||
@@ -116,7 +116,7 @@ static inline physid_mask_t summit_apicid_to_cpu_present(int apicid) | |||
116 | return physid_mask_of_physid(0); | 116 | return physid_mask_of_physid(0); |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline void setup_portio_remap(void) | 119 | static inline void summit_setup_portio_remap(void) |
120 | { | 120 | { |
121 | } | 121 | } |
122 | 122 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 812bf39de355..0e7d26c01f9f 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1170,7 +1170,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1170 | 1170 | ||
1171 | map_cpu_to_logical_apicid(); | 1171 | map_cpu_to_logical_apicid(); |
1172 | 1172 | ||
1173 | setup_portio_remap(); | 1173 | if (apic->setup_portio_remap) |
1174 | apic->setup_portio_remap(); | ||
1174 | 1175 | ||
1175 | smpboot_setup_io_apic(); | 1176 | smpboot_setup_io_apic(); |
1176 | /* | 1177 | /* |
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c index 613965230744..424740554a32 100644 --- a/arch/x86/mach-generic/bigsmp.c +++ b/arch/x86/mach-generic/bigsmp.c | |||
@@ -84,7 +84,7 @@ struct genapic apic_bigsmp = { | |||
84 | .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, | 84 | .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, |
85 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, | 85 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, |
86 | .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, | 86 | .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, |
87 | .setup_portio_remap = setup_portio_remap, | 87 | .setup_portio_remap = NULL, |
88 | .check_phys_apicid_present = check_phys_apicid_present, | 88 | .check_phys_apicid_present = check_phys_apicid_present, |
89 | .enable_apic_mode = enable_apic_mode, | 89 | .enable_apic_mode = enable_apic_mode, |
90 | .phys_pkg_id = phys_pkg_id, | 90 | .phys_pkg_id = phys_pkg_id, |
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c index 8fc704a3db7c..b48a58daf719 100644 --- a/arch/x86/mach-generic/default.c +++ b/arch/x86/mach-generic/default.c | |||
@@ -65,7 +65,7 @@ struct genapic apic_default = { | |||
65 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, | 65 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, |
66 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 66 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
67 | .apicid_to_cpu_present = default_apicid_to_cpu_present, | 67 | .apicid_to_cpu_present = default_apicid_to_cpu_present, |
68 | .setup_portio_remap = setup_portio_remap, | 68 | .setup_portio_remap = NULL, |
69 | .check_phys_apicid_present = check_phys_apicid_present, | 69 | .check_phys_apicid_present = check_phys_apicid_present, |
70 | .enable_apic_mode = enable_apic_mode, | 70 | .enable_apic_mode = enable_apic_mode, |
71 | .phys_pkg_id = phys_pkg_id, | 71 | .phys_pkg_id = phys_pkg_id, |
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 1e0e16274557..449eca5b6048 100644 --- a/arch/x86/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c | |||
@@ -126,7 +126,7 @@ struct genapic apic_es7000 = { | |||
126 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, | 126 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, |
127 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | 127 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, |
128 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | 128 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, |
129 | .setup_portio_remap = setup_portio_remap, | 129 | .setup_portio_remap = NULL, |
130 | .check_phys_apicid_present = check_phys_apicid_present, | 130 | .check_phys_apicid_present = check_phys_apicid_present, |
131 | .enable_apic_mode = enable_apic_mode, | 131 | .enable_apic_mode = enable_apic_mode, |
132 | .phys_pkg_id = phys_pkg_id, | 132 | .phys_pkg_id = phys_pkg_id, |
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c index 839b86b765a1..e60361b0bf1e 100644 --- a/arch/x86/mach-generic/numaq.c +++ b/arch/x86/mach-generic/numaq.c | |||
@@ -44,6 +44,19 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask) | |||
44 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; | 44 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; |
45 | } | 45 | } |
46 | 46 | ||
47 | static void numaq_setup_portio_remap(void) | ||
48 | { | ||
49 | int num_quads = num_online_nodes(); | ||
50 | |||
51 | if (num_quads <= 1) | ||
52 | return; | ||
53 | |||
54 | printk("Remapping cross-quad port I/O for %d quads\n", num_quads); | ||
55 | xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD); | ||
56 | printk("xquad_portio vaddr 0x%08lx, len %08lx\n", | ||
57 | (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); | ||
58 | } | ||
59 | |||
47 | struct genapic apic_numaq = { | 60 | struct genapic apic_numaq = { |
48 | 61 | ||
49 | .name = "NUMAQ", | 62 | .name = "NUMAQ", |
@@ -71,7 +84,7 @@ struct genapic apic_numaq = { | |||
71 | .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, | 84 | .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, |
72 | .cpu_present_to_apicid = numaq_cpu_present_to_apicid, | 85 | .cpu_present_to_apicid = numaq_cpu_present_to_apicid, |
73 | .apicid_to_cpu_present = numaq_apicid_to_cpu_present, | 86 | .apicid_to_cpu_present = numaq_apicid_to_cpu_present, |
74 | .setup_portio_remap = setup_portio_remap, | 87 | .setup_portio_remap = numaq_setup_portio_remap, |
75 | .check_phys_apicid_present = check_phys_apicid_present, | 88 | .check_phys_apicid_present = check_phys_apicid_present, |
76 | .enable_apic_mode = enable_apic_mode, | 89 | .enable_apic_mode = enable_apic_mode, |
77 | .phys_pkg_id = phys_pkg_id, | 90 | .phys_pkg_id = phys_pkg_id, |
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c index b6e37607a523..ffcf7ca2e8ce 100644 --- a/arch/x86/mach-generic/summit.c +++ b/arch/x86/mach-generic/summit.c | |||
@@ -64,7 +64,7 @@ struct genapic apic_summit = { | |||
64 | .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, | 64 | .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, |
65 | .cpu_present_to_apicid = summit_cpu_present_to_apicid, | 65 | .cpu_present_to_apicid = summit_cpu_present_to_apicid, |
66 | .apicid_to_cpu_present = summit_apicid_to_cpu_present, | 66 | .apicid_to_cpu_present = summit_apicid_to_cpu_present, |
67 | .setup_portio_remap = setup_portio_remap, | 67 | .setup_portio_remap = NULL, |
68 | .check_phys_apicid_present = check_phys_apicid_present, | 68 | .check_phys_apicid_present = check_phys_apicid_present, |
69 | .enable_apic_mode = enable_apic_mode, | 69 | .enable_apic_mode = enable_apic_mode, |
70 | .phys_pkg_id = phys_pkg_id, | 70 | .phys_pkg_id = phys_pkg_id, |