~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/x86/kernel/apic/probe_32.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
}
53
53
late_initcall(print_ipi_mode);
54
54
 
55
 
void __init default_setup_apic_routing(void)
56
 
{
57
 
        int version = apic_version[boot_cpu_physical_apicid];
58
 
 
59
 
        if (num_possible_cpus() > 8) {
60
 
                switch (boot_cpu_data.x86_vendor) {
61
 
                case X86_VENDOR_INTEL:
62
 
                        if (!APIC_XAPIC(version)) {
63
 
                                def_to_bigsmp = 0;
64
 
                                break;
65
 
                        }
66
 
                        /* If P4 and above fall through */
67
 
                case X86_VENDOR_AMD:
68
 
                        def_to_bigsmp = 1;
69
 
                }
70
 
        }
71
 
 
72
 
#ifdef CONFIG_X86_BIGSMP
73
 
        generic_bigsmp_probe();
74
 
#endif
75
 
 
76
 
        if (apic->setup_apic_routing)
77
 
                apic->setup_apic_routing();
78
 
}
79
 
 
80
55
static int default_x86_32_early_logical_apicid(int cpu)
81
56
{
82
57
        return 1 << cpu;
112
87
        return 1;
113
88
}
114
89
 
115
 
struct apic apic_default = {
 
90
static struct apic apic_default = {
116
91
 
117
92
        .name                           = "default",
118
93
        .probe                          = probe_default,
172
147
        .safe_wait_icr_idle             = native_safe_apic_wait_icr_idle,
173
148
 
174
149
        .x86_32_early_logical_apicid    = default_x86_32_early_logical_apicid,
175
 
        .x86_32_numa_cpu_node           = default_x86_32_numa_cpu_node,
176
150
};
177
151
 
178
 
extern struct apic apic_numaq;
179
 
extern struct apic apic_summit;
180
 
extern struct apic apic_bigsmp;
181
 
extern struct apic apic_es7000;
182
 
extern struct apic apic_es7000_cluster;
 
152
apic_driver(apic_default);
183
153
 
184
154
struct apic *apic = &apic_default;
185
155
EXPORT_SYMBOL_GPL(apic);
186
156
 
187
 
static struct apic *apic_probe[] __initdata = {
188
 
#ifdef CONFIG_X86_NUMAQ
189
 
        &apic_numaq,
190
 
#endif
191
 
#ifdef CONFIG_X86_SUMMIT
192
 
        &apic_summit,
193
 
#endif
194
 
#ifdef CONFIG_X86_BIGSMP
195
 
        &apic_bigsmp,
196
 
#endif
197
 
#ifdef CONFIG_X86_ES7000
198
 
        &apic_es7000,
199
 
        &apic_es7000_cluster,
200
 
#endif
201
 
        &apic_default,  /* must be last */
202
 
        NULL,
203
 
};
204
 
 
205
157
static int cmdline_apic __initdata;
206
158
static int __init parse_apic(char *arg)
207
159
{
208
 
        int i;
 
160
        struct apic **drv;
209
161
 
210
162
        if (!arg)
211
163
                return -EINVAL;
212
164
 
213
 
        for (i = 0; apic_probe[i]; i++) {
214
 
                if (!strcmp(apic_probe[i]->name, arg)) {
215
 
                        apic = apic_probe[i];
 
165
        for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
 
166
                if (!strcmp((*drv)->name, arg)) {
 
167
                        apic = *drv;
216
168
                        cmdline_apic = 1;
217
169
                        return 0;
218
170
                }
223
175
}
224
176
early_param("apic", parse_apic);
225
177
 
226
 
void __init generic_bigsmp_probe(void)
 
178
void __init default_setup_apic_routing(void)
227
179
{
 
180
        int version = apic_version[boot_cpu_physical_apicid];
 
181
 
 
182
        if (num_possible_cpus() > 8) {
 
183
                switch (boot_cpu_data.x86_vendor) {
 
184
                case X86_VENDOR_INTEL:
 
185
                        if (!APIC_XAPIC(version)) {
 
186
                                def_to_bigsmp = 0;
 
187
                                break;
 
188
                        }
 
189
                        /* If P4 and above fall through */
 
190
                case X86_VENDOR_AMD:
 
191
                        def_to_bigsmp = 1;
 
192
                }
 
193
        }
 
194
 
228
195
#ifdef CONFIG_X86_BIGSMP
229
196
        /*
230
 
         * This routine is used to switch to bigsmp mode when
 
197
         * This is used to switch to bigsmp mode when
231
198
         * - There is no apic= option specified by the user
232
199
         * - generic_apic_probe() has chosen apic_default as the sub_arch
233
200
         * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
234
201
         */
235
202
 
236
203
        if (!cmdline_apic && apic == &apic_default) {
237
 
                if (apic_bigsmp.probe()) {
238
 
                        apic = &apic_bigsmp;
 
204
                struct apic *bigsmp = generic_bigsmp_probe();
 
205
                if (bigsmp) {
 
206
                        apic = bigsmp;
239
207
                        printk(KERN_INFO "Overriding APIC driver with %s\n",
240
208
                               apic->name);
241
209
                }
242
210
        }
243
211
#endif
 
212
 
 
213
        if (apic->setup_apic_routing)
 
214
                apic->setup_apic_routing();
244
215
}
245
216
 
246
217
void __init generic_apic_probe(void)
247
218
{
248
219
        if (!cmdline_apic) {
249
 
                int i;
250
 
                for (i = 0; apic_probe[i]; i++) {
251
 
                        if (apic_probe[i]->probe()) {
252
 
                                apic = apic_probe[i];
 
220
                struct apic **drv;
 
221
 
 
222
                for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
 
223
                        if ((*drv)->probe()) {
 
224
                                apic = *drv;
253
225
                                break;
254
226
                        }
255
227
                }
256
228
                /* Not visible without early console */
257
 
                if (!apic_probe[i])
 
229
                if (drv == __apicdrivers_end)
258
230
                        panic("Didn't find an APIC driver");
259
231
        }
260
232
        printk(KERN_INFO "Using APIC driver %s\n", apic->name);
265
237
int __init
266
238
generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
267
239
{
268
 
        int i;
 
240
        struct apic **drv;
269
241
 
270
 
        for (i = 0; apic_probe[i]; ++i) {
271
 
                if (!apic_probe[i]->mps_oem_check)
 
242
        for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
 
243
                if (!((*drv)->mps_oem_check))
272
244
                        continue;
273
 
                if (!apic_probe[i]->mps_oem_check(mpc, oem, productid))
 
245
                if (!(*drv)->mps_oem_check(mpc, oem, productid))
274
246
                        continue;
275
247
 
276
248
                if (!cmdline_apic) {
277
 
                        apic = apic_probe[i];
 
249
                        apic = *drv;
278
250
                        printk(KERN_INFO "Switched to APIC driver `%s'.\n",
279
251
                               apic->name);
280
252
                }
285
257
 
286
258
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
287
259
{
288
 
        int i;
 
260
        struct apic **drv;
289
261
 
290
 
        for (i = 0; apic_probe[i]; ++i) {
291
 
                if (!apic_probe[i]->acpi_madt_oem_check)
 
262
        for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
 
263
                if (!(*drv)->acpi_madt_oem_check)
292
264
                        continue;
293
 
                if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id))
 
265
                if (!(*drv)->acpi_madt_oem_check(oem_id, oem_table_id))
294
266
                        continue;
295
267
 
296
268
                if (!cmdline_apic) {
297
 
                        apic = apic_probe[i];
 
269
                        apic = *drv;
298
270
                        printk(KERN_INFO "Switched to APIC driver `%s'.\n",
299
271
                               apic->name);
300
272
                }