diff options
Diffstat (limited to 'arch/i386/mach-generic')
-rw-r--r-- | arch/i386/mach-generic/bigsmp.c | 1 | ||||
-rw-r--r-- | arch/i386/mach-generic/es7000.c | 1 | ||||
-rw-r--r-- | arch/i386/mach-generic/probe.c | 60 | ||||
-rw-r--r-- | arch/i386/mach-generic/summit.c | 1 |
4 files changed, 33 insertions, 30 deletions
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c index ef7a6e6fcb9f..33d9f93557ba 100644 --- a/arch/i386/mach-generic/bigsmp.c +++ b/arch/i386/mach-generic/bigsmp.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #define APIC_DEFINITION 1 | 5 | #define APIC_DEFINITION 1 |
6 | #include <linux/threads.h> | 6 | #include <linux/threads.h> |
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <asm/smp.h> | ||
8 | #include <asm/mpspec.h> | 9 | #include <asm/mpspec.h> |
9 | #include <asm/genapic.h> | 10 | #include <asm/genapic.h> |
10 | #include <asm/fixmap.h> | 11 | #include <asm/fixmap.h> |
diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c index 845cdd0b3593..aa144d82334d 100644 --- a/arch/i386/mach-generic/es7000.c +++ b/arch/i386/mach-generic/es7000.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #define APIC_DEFINITION 1 | 4 | #define APIC_DEFINITION 1 |
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/cpumask.h> | 6 | #include <linux/cpumask.h> |
7 | #include <asm/smp.h> | ||
7 | #include <asm/mpspec.h> | 8 | #include <asm/mpspec.h> |
8 | #include <asm/genapic.h> | 9 | #include <asm/genapic.h> |
9 | #include <asm/fixmap.h> | 10 | #include <asm/fixmap.h> |
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c index bcd1bcfaa723..94b1fd9cbe3c 100644 --- a/arch/i386/mach-generic/probe.c +++ b/arch/i386/mach-generic/probe.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/ctype.h> | 10 | #include <linux/ctype.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/errno.h> | ||
12 | #include <asm/fixmap.h> | 13 | #include <asm/fixmap.h> |
13 | #include <asm/mpspec.h> | 14 | #include <asm/mpspec.h> |
14 | #include <asm/apicdef.h> | 15 | #include <asm/apicdef.h> |
@@ -29,7 +30,24 @@ struct genapic *apic_probe[] __initdata = { | |||
29 | NULL, | 30 | NULL, |
30 | }; | 31 | }; |
31 | 32 | ||
32 | static int cmdline_apic; | 33 | static int cmdline_apic __initdata; |
34 | static int __init parse_apic(char *arg) | ||
35 | { | ||
36 | int i; | ||
37 | |||
38 | if (!arg) | ||
39 | return -EINVAL; | ||
40 | |||
41 | for (i = 0; apic_probe[i]; i++) { | ||
42 | if (!strcmp(apic_probe[i]->name, arg)) { | ||
43 | genapic = apic_probe[i]; | ||
44 | cmdline_apic = 1; | ||
45 | return 0; | ||
46 | } | ||
47 | } | ||
48 | return -ENOENT; | ||
49 | } | ||
50 | early_param("apic", parse_apic); | ||
33 | 51 | ||
34 | void __init generic_bigsmp_probe(void) | 52 | void __init generic_bigsmp_probe(void) |
35 | { | 53 | { |
@@ -48,40 +66,20 @@ void __init generic_bigsmp_probe(void) | |||
48 | } | 66 | } |
49 | } | 67 | } |
50 | 68 | ||
51 | void __init generic_apic_probe(char *command_line) | 69 | void __init generic_apic_probe(void) |
52 | { | 70 | { |
53 | char *s; | 71 | if (!cmdline_apic) { |
54 | int i; | 72 | int i; |
55 | int changed = 0; | 73 | for (i = 0; apic_probe[i]; i++) { |
56 | 74 | if (apic_probe[i]->probe()) { | |
57 | s = strstr(command_line, "apic="); | ||
58 | if (s && (s == command_line || isspace(s[-1]))) { | ||
59 | char *p = strchr(s, ' '), old; | ||
60 | if (!p) | ||
61 | p = strchr(s, '\0'); | ||
62 | old = *p; | ||
63 | *p = 0; | ||
64 | for (i = 0; !changed && apic_probe[i]; i++) { | ||
65 | if (!strcmp(apic_probe[i]->name, s+5)) { | ||
66 | changed = 1; | ||
67 | genapic = apic_probe[i]; | 75 | genapic = apic_probe[i]; |
76 | break; | ||
68 | } | 77 | } |
69 | } | 78 | } |
70 | if (!changed) | 79 | /* Not visible without early console */ |
71 | printk(KERN_ERR "Unknown genapic `%s' specified.\n", s); | 80 | if (!apic_probe[i]) |
72 | *p = old; | 81 | panic("Didn't find an APIC driver"); |
73 | cmdline_apic = changed; | ||
74 | } | ||
75 | for (i = 0; !changed && apic_probe[i]; i++) { | ||
76 | if (apic_probe[i]->probe()) { | ||
77 | changed = 1; | ||
78 | genapic = apic_probe[i]; | ||
79 | } | ||
80 | } | 82 | } |
81 | /* Not visible without early console */ | ||
82 | if (!changed) | ||
83 | panic("Didn't find an APIC driver"); | ||
84 | |||
85 | printk(KERN_INFO "Using APIC driver %s\n", genapic->name); | 83 | printk(KERN_INFO "Using APIC driver %s\n", genapic->name); |
86 | } | 84 | } |
87 | 85 | ||
@@ -119,7 +117,9 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
119 | return 0; | 117 | return 0; |
120 | } | 118 | } |
121 | 119 | ||
120 | #ifdef CONFIG_SMP | ||
122 | int hard_smp_processor_id(void) | 121 | int hard_smp_processor_id(void) |
123 | { | 122 | { |
124 | return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID)); | 123 | return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID)); |
125 | } | 124 | } |
125 | #endif | ||
diff --git a/arch/i386/mach-generic/summit.c b/arch/i386/mach-generic/summit.c index b73501ddd653..f7e5d66648dc 100644 --- a/arch/i386/mach-generic/summit.c +++ b/arch/i386/mach-generic/summit.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #define APIC_DEFINITION 1 | 4 | #define APIC_DEFINITION 1 |
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/cpumask.h> | 6 | #include <linux/cpumask.h> |
7 | #include <asm/smp.h> | ||
7 | #include <asm/mpspec.h> | 8 | #include <asm/mpspec.h> |
8 | #include <asm/genapic.h> | 9 | #include <asm/genapic.h> |
9 | #include <asm/fixmap.h> | 10 | #include <asm/fixmap.h> |