diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-27 21:43:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:12 -0500 |
commit | 306db03b0d71bf9c94155c0c4771a79fc70b4b27 (patch) | |
tree | 060e085368664f142013b65cbc0271a704b7dbc3 /arch | |
parent | 9a6801da55e4a4492e8f666ac272efe8186682c8 (diff) |
x86: clean up apic->acpi_madt_oem_check methods
Impact: refactor code
x86 subarchitectures each defined a "acpi_madt_oem_check()" method,
which could be an inline function, or an extern, or a static function,
and which was also the name of a genapic field.
Untangle this namespace spaghetti by setting ->acpi_madt_oem_check()
to NULL on those subarchitectures that have no detection quirks,
and rename the other ones (summit, es7000) that do.
Also change default_acpi_madt_oem_check() to handle NULL entries,
and clean its control flow up as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/es7000/mpparse.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/genapic.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_mpparse.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_mpparse.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/mpparse.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/genapic_64.c | 2 | ||||
-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 | 6 | ||||
-rw-r--r-- | arch/x86/mach-generic/numaq.c | 8 | ||||
-rw-r--r-- | arch/x86/mach-generic/probe.c | 24 | ||||
-rw-r--r-- | arch/x86/mach-generic/summit.c | 2 |
13 files changed, 29 insertions, 30 deletions
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h index c1629b090ec2..30692c4ae859 100644 --- a/arch/x86/include/asm/es7000/mpparse.h +++ b/arch/x86/include/asm/es7000/mpparse.h | |||
@@ -9,7 +9,7 @@ extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr); | |||
9 | extern void setup_unisys(void); | 9 | extern void setup_unisys(void); |
10 | 10 | ||
11 | #ifndef CONFIG_X86_GENERICARCH | 11 | #ifndef CONFIG_X86_GENERICARCH |
12 | extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); | 12 | extern int default_acpi_madt_oem_check(char *oem_id, char *oem_table_id); |
13 | extern int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid); | 13 | extern int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid); |
14 | #endif | 14 | #endif |
15 | 15 | ||
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h index 26c5e824a717..108abdf6953b 100644 --- a/arch/x86/include/asm/genapic.h +++ b/arch/x86/include/asm/genapic.h | |||
@@ -103,7 +103,7 @@ extern struct genapic apic_flat; | |||
103 | extern struct genapic apic_physflat; | 103 | extern struct genapic apic_physflat; |
104 | extern struct genapic apic_x2apic_cluster; | 104 | extern struct genapic apic_x2apic_cluster; |
105 | extern struct genapic apic_x2apic_phys; | 105 | extern struct genapic apic_x2apic_phys; |
106 | extern int acpi_madt_oem_check(char *, char *); | 106 | extern int default_acpi_madt_oem_check(char *, char *); |
107 | 107 | ||
108 | extern void apic_send_IPI_self(int vector); | 108 | extern void apic_send_IPI_self(int vector); |
109 | 109 | ||
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h index c70a263d68cd..8fa01770ba62 100644 --- a/arch/x86/include/asm/mach-default/mach_mpparse.h +++ b/arch/x86/include/asm/mach-default/mach_mpparse.h | |||
@@ -8,7 +8,7 @@ mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | |||
8 | } | 8 | } |
9 | 9 | ||
10 | /* Hook from generic ACPI tables.c */ | 10 | /* Hook from generic ACPI tables.c */ |
11 | static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 11 | static inline int default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
12 | { | 12 | { |
13 | return 0; | 13 | return 0; |
14 | } | 14 | } |
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h index 9444ab8dca94..f497d96c76bb 100644 --- a/arch/x86/include/asm/mach-generic/mach_mpparse.h +++ b/arch/x86/include/asm/mach-generic/mach_mpparse.h | |||
@@ -4,6 +4,6 @@ | |||
4 | 4 | ||
5 | extern int mps_oem_check(struct mpc_table *, char *, char *); | 5 | extern int mps_oem_check(struct mpc_table *, char *, char *); |
6 | 6 | ||
7 | extern int acpi_madt_oem_check(char *, char *); | 7 | extern int default_acpi_madt_oem_check(char *, char *); |
8 | 8 | ||
9 | #endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */ | 9 | #endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */ |
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h index 380e86c02363..555ed8238e94 100644 --- a/arch/x86/include/asm/summit/mpparse.h +++ b/arch/x86/include/asm/summit/mpparse.h | |||
@@ -27,7 +27,7 @@ static inline int mps_oem_check(struct mpc_table *mpc, char *oem, | |||
27 | } | 27 | } |
28 | 28 | ||
29 | /* Hook from generic ACPI tables.c */ | 29 | /* Hook from generic ACPI tables.c */ |
30 | static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 30 | static inline int summit_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
31 | { | 31 | { |
32 | if (!strncmp(oem_id, "IBM", 3) && | 32 | if (!strncmp(oem_id, "IBM", 3) && |
33 | (!strncmp(oem_table_id, "SERVIGIL", 8) | 33 | (!strncmp(oem_table_id, "SERVIGIL", 8) |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 4cb5964f1499..314fe0dddef4 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -239,7 +239,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) | |||
239 | madt->address); | 239 | madt->address); |
240 | } | 240 | } |
241 | 241 | ||
242 | acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); | 242 | default_acpi_madt_oem_check(madt->header.oem_id, |
243 | madt->header.oem_table_id); | ||
243 | 244 | ||
244 | return 0; | 245 | return 0; |
245 | } | 246 | } |
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 2b986389a24f..060945b8eec4 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c | |||
@@ -68,7 +68,7 @@ void apic_send_IPI_self(int vector) | |||
68 | __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); | 68 | __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); |
69 | } | 69 | } |
70 | 70 | ||
71 | int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 71 | int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
72 | { | 72 | { |
73 | int i; | 73 | int i; |
74 | 74 | ||
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c index 13e82bc4dae6..22c3608b80dd 100644 --- a/arch/x86/mach-generic/bigsmp.c +++ b/arch/x86/mach-generic/bigsmp.c | |||
@@ -61,7 +61,7 @@ struct genapic apic_bigsmp = { | |||
61 | 61 | ||
62 | .name = "bigsmp", | 62 | .name = "bigsmp", |
63 | .probe = probe_bigsmp, | 63 | .probe = probe_bigsmp, |
64 | .acpi_madt_oem_check = acpi_madt_oem_check, | 64 | .acpi_madt_oem_check = NULL, |
65 | .apic_id_registered = apic_id_registered, | 65 | .apic_id_registered = apic_id_registered, |
66 | 66 | ||
67 | .int_delivery_mode = INT_DELIVERY_MODE, | 67 | .int_delivery_mode = INT_DELIVERY_MODE, |
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c index d5fec764fb40..cfec3494a967 100644 --- a/arch/x86/mach-generic/default.c +++ b/arch/x86/mach-generic/default.c | |||
@@ -28,7 +28,7 @@ struct genapic apic_default = { | |||
28 | 28 | ||
29 | .name = "default", | 29 | .name = "default", |
30 | .probe = probe_default, | 30 | .probe = probe_default, |
31 | .acpi_madt_oem_check = acpi_madt_oem_check, | 31 | .acpi_madt_oem_check = NULL, |
32 | .apic_id_registered = apic_id_registered, | 32 | .apic_id_registered = apic_id_registered, |
33 | 33 | ||
34 | .int_delivery_mode = INT_DELIVERY_MODE, | 34 | .int_delivery_mode = INT_DELIVERY_MODE, |
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 4a404ea5f928..23fe6f1c9691 100644 --- a/arch/x86/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c | |||
@@ -57,7 +57,7 @@ mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | |||
57 | 57 | ||
58 | #ifdef CONFIG_ACPI | 58 | #ifdef CONFIG_ACPI |
59 | /* Hook from generic ACPI tables.c */ | 59 | /* Hook from generic ACPI tables.c */ |
60 | static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 60 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
61 | { | 61 | { |
62 | unsigned long oem_addr = 0; | 62 | unsigned long oem_addr = 0; |
63 | int check_dsdt; | 63 | int check_dsdt; |
@@ -81,7 +81,7 @@ static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
81 | return ret; | 81 | return ret; |
82 | } | 82 | } |
83 | #else | 83 | #else |
84 | static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 84 | static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
85 | { | 85 | { |
86 | return 0; | 86 | return 0; |
87 | } | 87 | } |
@@ -104,7 +104,7 @@ struct genapic apic_es7000 = { | |||
104 | 104 | ||
105 | .name = "es7000", | 105 | .name = "es7000", |
106 | .probe = probe_es7000, | 106 | .probe = probe_es7000, |
107 | .acpi_madt_oem_check = acpi_madt_oem_check, | 107 | .acpi_madt_oem_check = es7000_acpi_madt_oem_check, |
108 | .apic_id_registered = apic_id_registered, | 108 | .apic_id_registered = apic_id_registered, |
109 | 109 | ||
110 | .int_delivery_mode = INT_DELIVERY_MODE, | 110 | .int_delivery_mode = INT_DELIVERY_MODE, |
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c index fa486ca49c0a..9691b4e1654d 100644 --- a/arch/x86/mach-generic/numaq.c +++ b/arch/x86/mach-generic/numaq.c | |||
@@ -31,12 +31,6 @@ static int probe_numaq(void) | |||
31 | return found_numaq; | 31 | return found_numaq; |
32 | } | 32 | } |
33 | 33 | ||
34 | /* Hook from generic ACPI tables.c */ | ||
35 | static int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | ||
36 | { | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static void vector_allocation_domain(int cpu, cpumask_t *retmask) | 34 | static void vector_allocation_domain(int cpu, cpumask_t *retmask) |
41 | { | 35 | { |
42 | /* Careful. Some cpus do not strictly honor the set of cpus | 36 | /* Careful. Some cpus do not strictly honor the set of cpus |
@@ -54,7 +48,7 @@ struct genapic apic_numaq = { | |||
54 | 48 | ||
55 | .name = "NUMAQ", | 49 | .name = "NUMAQ", |
56 | .probe = probe_numaq, | 50 | .probe = probe_numaq, |
57 | .acpi_madt_oem_check = acpi_madt_oem_check, | 51 | .acpi_madt_oem_check = NULL, |
58 | .apic_id_registered = apic_id_registered, | 52 | .apic_id_registered = apic_id_registered, |
59 | 53 | ||
60 | .int_delivery_mode = INT_DELIVERY_MODE, | 54 | .int_delivery_mode = INT_DELIVERY_MODE, |
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c index 82bf0f520fb6..a21e2b1a7011 100644 --- a/arch/x86/mach-generic/probe.c +++ b/arch/x86/mach-generic/probe.c | |||
@@ -128,20 +128,24 @@ int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | |||
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | 130 | ||
131 | int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 131 | int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
132 | { | 132 | { |
133 | int i; | 133 | int i; |
134 | |||
134 | for (i = 0; apic_probe[i]; ++i) { | 135 | for (i = 0; apic_probe[i]; ++i) { |
135 | if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { | 136 | if (!apic_probe[i]->acpi_madt_oem_check) |
136 | if (!cmdline_apic) { | 137 | continue; |
137 | apic = apic_probe[i]; | 138 | if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) |
138 | if (x86_quirks->update_genapic) | 139 | continue; |
139 | x86_quirks->update_genapic(); | 140 | |
140 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | 141 | if (!cmdline_apic) { |
141 | apic->name); | 142 | apic = apic_probe[i]; |
142 | } | 143 | if (x86_quirks->update_genapic) |
143 | return 1; | 144 | x86_quirks->update_genapic(); |
145 | printk(KERN_INFO "Switched to APIC driver `%s'.\n", | ||
146 | apic->name); | ||
144 | } | 147 | } |
148 | return 1; | ||
145 | } | 149 | } |
146 | return 0; | 150 | return 0; |
147 | } | 151 | } |
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c index 479c1d409779..0eea9fbb2a50 100644 --- a/arch/x86/mach-generic/summit.c +++ b/arch/x86/mach-generic/summit.c | |||
@@ -41,7 +41,7 @@ struct genapic apic_summit = { | |||
41 | 41 | ||
42 | .name = "summit", | 42 | .name = "summit", |
43 | .probe = probe_summit, | 43 | .probe = probe_summit, |
44 | .acpi_madt_oem_check = acpi_madt_oem_check, | 44 | .acpi_madt_oem_check = summit_acpi_madt_oem_check, |
45 | .apic_id_registered = apic_id_registered, | 45 | .apic_id_registered = apic_id_registered, |
46 | 46 | ||
47 | .int_delivery_mode = INT_DELIVERY_MODE, | 47 | .int_delivery_mode = INT_DELIVERY_MODE, |