diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2011-05-20 20:51:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-05-22 05:48:03 -0400 |
commit | 8b37e88061e229e78959fe3257649fd5ce05f8af (patch) | |
tree | 4c58ea023a554c1bec8be80f7fd4045a4747a09f /arch/x86/kernel/apic/probe_32.c | |
parent | 107e0e0cd85beeee05af7ea374fda14d037ee500 (diff) |
x86, apic: Use .apicdrivers section for the apic drivers list
This will eliminate the need for apic_probe[], as the probing
now will happen based on the apic drivers order in the
.apcidrivers section.
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.164277071@sbsiddha-MOBL3.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/probe_32.c')
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index a319b33cfc14..8796e1d25f0c 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -206,14 +206,14 @@ static struct apic *apic_probe[] __initdata = { | |||
206 | static int cmdline_apic __initdata; | 206 | static int cmdline_apic __initdata; |
207 | static int __init parse_apic(char *arg) | 207 | static int __init parse_apic(char *arg) |
208 | { | 208 | { |
209 | int i; | 209 | struct apic **drv; |
210 | 210 | ||
211 | if (!arg) | 211 | if (!arg) |
212 | return -EINVAL; | 212 | return -EINVAL; |
213 | 213 | ||
214 | for (i = 0; apic_probe[i]; i++) { | 214 | for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { |
215 | if (!strcmp(apic_probe[i]->name, arg)) { | 215 | if (!strcmp((*drv)->name, arg)) { |
216 | apic = apic_probe[i]; | 216 | apic = *drv; |
217 | cmdline_apic = 1; | 217 | cmdline_apic = 1; |
218 | return 0; | 218 | return 0; |
219 | } | 219 | } |
@@ -247,15 +247,16 @@ void __init generic_bigsmp_probe(void) | |||
247 | void __init generic_apic_probe(void) | 247 | void __init generic_apic_probe(void) |
248 | { | 248 | { |
249 | if (!cmdline_apic) { | 249 | if (!cmdline_apic) { |
250 | int i; | 250 | struct apic **drv; |
251 | for (i = 0; apic_probe[i]; i++) { | 251 | |
252 | if (apic_probe[i]->probe()) { | 252 | for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { |
253 | apic = apic_probe[i]; | 253 | if ((*drv)->probe()) { |
254 | apic = *drv; | ||
254 | break; | 255 | break; |
255 | } | 256 | } |
256 | } | 257 | } |
257 | /* Not visible without early console */ | 258 | /* Not visible without early console */ |
258 | if (!apic_probe[i]) | 259 | if (drv == __apicdrivers_end) |
259 | panic("Didn't find an APIC driver"); | 260 | panic("Didn't find an APIC driver"); |
260 | } | 261 | } |
261 | printk(KERN_INFO "Using APIC driver %s\n", apic->name); | 262 | printk(KERN_INFO "Using APIC driver %s\n", apic->name); |
@@ -266,16 +267,16 @@ void __init generic_apic_probe(void) | |||
266 | int __init | 267 | int __init |
267 | generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | 268 | generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) |
268 | { | 269 | { |
269 | int i; | 270 | struct apic **drv; |
270 | 271 | ||
271 | for (i = 0; apic_probe[i]; ++i) { | 272 | for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { |
272 | if (!apic_probe[i]->mps_oem_check) | 273 | if (!((*drv)->mps_oem_check)) |
273 | continue; | 274 | continue; |
274 | if (!apic_probe[i]->mps_oem_check(mpc, oem, productid)) | 275 | if (!(*drv)->mps_oem_check(mpc, oem, productid)) |
275 | continue; | 276 | continue; |
276 | 277 | ||
277 | if (!cmdline_apic) { | 278 | if (!cmdline_apic) { |
278 | apic = apic_probe[i]; | 279 | apic = *drv; |
279 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 280 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
280 | apic->name); | 281 | apic->name); |
281 | } | 282 | } |
@@ -286,16 +287,16 @@ generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | |||
286 | 287 | ||
287 | int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 288 | int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
288 | { | 289 | { |
289 | int i; | 290 | struct apic **drv; |
290 | 291 | ||
291 | for (i = 0; apic_probe[i]; ++i) { | 292 | for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { |
292 | if (!apic_probe[i]->acpi_madt_oem_check) | 293 | if (!(*drv)->acpi_madt_oem_check) |
293 | continue; | 294 | continue; |
294 | if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) | 295 | if (!(*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) |
295 | continue; | 296 | continue; |
296 | 297 | ||
297 | if (!cmdline_apic) { | 298 | if (!cmdline_apic) { |
298 | apic = apic_probe[i]; | 299 | apic = *drv; |
299 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 300 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", |
300 | apic->name); | 301 | apic->name); |
301 | } | 302 | } |