blob: 5c0c4bb5727d02c9cea7273977120e7a8f8a5bbb [file] [log] [blame]
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -03001#include <linux/kernel.h>
2#include <linux/module.h>
3#include <linux/init.h>
4#include <linux/bootmem.h>
5#include <linux/percpu.h>
Bernhard Walle1ecd2762008-06-20 15:38:22 +02006#include <linux/kexec.h>
Yinghai Lu17b4cce2008-06-21 21:02:20 -07007#include <linux/crash_dump.h>
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -03008#include <asm/smp.h>
9#include <asm/percpu.h>
10#include <asm/sections.h>
11#include <asm/processor.h>
12#include <asm/setup.h>
13#include <asm/topology.h>
Alexey Starikovskiy0fc09062008-04-04 23:40:48 +040014#include <asm/mpspec.h>
Alexey Starikovskiy76eb4132008-04-04 23:40:41 +040015#include <asm/apicdef.h>
Bernhard Walle1ecd2762008-06-20 15:38:22 +020016#include <asm/highmem.h>
Alexey Starikovskiy76eb4132008-04-04 23:40:41 +040017
Yinghai Lu7f0be022008-06-22 17:37:54 -070018#ifndef CONFIG_DEBUG_BOOT_PARAMS
19struct boot_params __initdata boot_params;
20#else
21struct boot_params boot_params;
22#endif
23
James Bottomleyf8955eb2008-05-10 09:01:48 -050024#ifdef CONFIG_X86_LOCAL_APIC
Alexey Starikovskiy2fe60142008-04-04 23:41:44 +040025unsigned int num_processors;
26unsigned disabled_cpus __cpuinitdata;
27/* Processor that is doing the boot up */
28unsigned int boot_cpu_physical_apicid = -1U;
Yinghai Lue0da3362008-06-08 18:29:22 -070029unsigned int max_physical_apicid;
Alexey Starikovskiy2fe60142008-04-04 23:41:44 +040030EXPORT_SYMBOL(boot_cpu_physical_apicid);
31
Alexey Starikovskiy0fc09062008-04-04 23:40:48 +040032/* Bitmask of physically existing CPUs */
33physid_mask_t phys_cpu_present_map;
James Bottomleyf8955eb2008-05-10 09:01:48 -050034#endif
Alexey Starikovskiy0fc09062008-04-04 23:40:48 +040035
Mike Travis23ca4bb2008-05-12 21:21:12 +020036/* map cpu index to physical APIC ID */
37DEFINE_EARLY_PER_CPU(u16, x86_cpu_to_apicid, BAD_APICID);
38DEFINE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid, BAD_APICID);
39EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_apicid);
40EXPORT_EARLY_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
41
42#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
43#define X86_64_NUMA 1
44
Mike Travis7891a242008-05-12 21:21:12 +020045/* map cpu index to node index */
Mike Travis23ca4bb2008-05-12 21:21:12 +020046DEFINE_EARLY_PER_CPU(int, x86_cpu_to_node_map, NUMA_NO_NODE);
47EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map);
Mike Travis9f248bd2008-05-12 21:21:12 +020048
49/* which logical CPUs are on which nodes */
50cpumask_t *node_to_cpumask_map;
51EXPORT_SYMBOL(node_to_cpumask_map);
52
53/* setup node_to_cpumask_map */
54static void __init setup_node_to_cpumask_map(void);
55
56#else
57static inline void setup_node_to_cpumask_map(void) { }
Mike Travis23ca4bb2008-05-12 21:21:12 +020058#endif
59
James Bottomleyf8955eb2008-05-10 09:01:48 -050060#if defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) && defined(CONFIG_X86_SMP)
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -030061/*
62 * Copy data used in early init routines from the initial arrays to the
63 * per cpu data areas. These arrays then become expendable and the
64 * *_early_ptr's are zeroed indicating that the static arrays are gone.
65 */
66static void __init setup_per_cpu_maps(void)
67{
68 int cpu;
69
70 for_each_possible_cpu(cpu) {
Mike Travis23ca4bb2008-05-12 21:21:12 +020071 per_cpu(x86_cpu_to_apicid, cpu) =
72 early_per_cpu_map(x86_cpu_to_apicid, cpu);
Mike Travisb447a462008-03-25 15:06:51 -070073 per_cpu(x86_bios_cpu_apicid, cpu) =
Mike Travis23ca4bb2008-05-12 21:21:12 +020074 early_per_cpu_map(x86_bios_cpu_apicid, cpu);
75#ifdef X86_64_NUMA
Mike Travisb447a462008-03-25 15:06:51 -070076 per_cpu(x86_cpu_to_node_map, cpu) =
Mike Travis23ca4bb2008-05-12 21:21:12 +020077 early_per_cpu_map(x86_cpu_to_node_map, cpu);
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -030078#endif
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -030079 }
80
81 /* indicate the early static arrays will soon be gone */
Mike Travis23ca4bb2008-05-12 21:21:12 +020082 early_per_cpu_ptr(x86_cpu_to_apicid) = NULL;
83 early_per_cpu_ptr(x86_bios_cpu_apicid) = NULL;
84#ifdef X86_64_NUMA
85 early_per_cpu_ptr(x86_cpu_to_node_map) = NULL;
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -030086#endif
87}
88
Mike Travis9f0e8d02008-04-04 18:11:01 -070089#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
90cpumask_t *cpumask_of_cpu_map __read_mostly;
91EXPORT_SYMBOL(cpumask_of_cpu_map);
92
93/* requires nr_cpu_ids to be initialized */
94static void __init setup_cpumask_of_cpu(void)
95{
96 int i;
97
98 /* alloc_bootmem zeroes memory */
99 cpumask_of_cpu_map = alloc_bootmem_low(sizeof(cpumask_t) * nr_cpu_ids);
100 for (i = 0; i < nr_cpu_ids; i++)
101 cpu_set(i, cpumask_of_cpu_map[i]);
102}
103#else
104static inline void setup_cpumask_of_cpu(void) { }
105#endif
106
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300107#ifdef CONFIG_X86_32
108/*
109 * Great future not-so-futuristic plan: make i386 and x86_64 do it
110 * the same way
111 */
112unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
113EXPORT_SYMBOL(__per_cpu_offset);
Mike Travis3461b0a2008-05-12 21:21:13 +0200114static inline void setup_cpu_pda_map(void) { }
115
116#elif !defined(CONFIG_SMP)
117static inline void setup_cpu_pda_map(void) { }
118
119#else /* CONFIG_SMP && CONFIG_X86_64 */
120
121/*
122 * Allocate cpu_pda pointer table and array via alloc_bootmem.
123 */
124static void __init setup_cpu_pda_map(void)
125{
126 char *pda;
127 struct x8664_pda **new_cpu_pda;
128 unsigned long size;
129 int cpu;
130
131 size = roundup(sizeof(struct x8664_pda), cache_line_size());
132
133 /* allocate cpu_pda array and pointer table */
134 {
135 unsigned long tsize = nr_cpu_ids * sizeof(void *);
136 unsigned long asize = size * (nr_cpu_ids - 1);
137
138 tsize = roundup(tsize, cache_line_size());
139 new_cpu_pda = alloc_bootmem(tsize + asize);
140 pda = (char *)new_cpu_pda + tsize;
141 }
142
143 /* initialize pointer table to static pda's */
144 for_each_possible_cpu(cpu) {
145 if (cpu == 0) {
146 /* leave boot cpu pda in place */
147 new_cpu_pda[0] = cpu_pda(0);
148 continue;
149 }
150 new_cpu_pda[cpu] = (struct x8664_pda *)pda;
151 new_cpu_pda[cpu]->in_bootmem = 1;
152 pda += size;
153 }
154
155 /* point to new pointer table */
156 _cpu_pda = new_cpu_pda;
157}
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300158#endif
159
160/*
161 * Great future plan:
162 * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
163 * Always point %gs to its beginning
164 */
165void __init setup_per_cpu_areas(void)
166{
Mike Travis3461b0a2008-05-12 21:21:13 +0200167 ssize_t size = PERCPU_ENOUGH_ROOM;
168 char *ptr;
169 int cpu;
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300170
Yinghai Lu3c999f12008-06-20 16:11:20 -0700171 /* no processor from mptable or madt */
172 if (!num_processors)
173 num_processors = 1;
174
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300175#ifdef CONFIG_HOTPLUG_CPU
176 prefill_possible_map();
Mike Travis3461b0a2008-05-12 21:21:13 +0200177#else
178 nr_cpu_ids = num_processors;
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300179#endif
180
Mike Travis3461b0a2008-05-12 21:21:13 +0200181 /* Setup cpu_pda map */
182 setup_cpu_pda_map();
183
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300184 /* Copy section for each CPU (we discard the original) */
185 size = PERCPU_ENOUGH_ROOM;
Randy Dunlap053713f2008-06-05 11:10:59 -0700186 printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300187 size);
Mike Travisb447a462008-03-25 15:06:51 -0700188
Mike Travis3461b0a2008-05-12 21:21:13 +0200189 for_each_possible_cpu(cpu) {
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300190#ifndef CONFIG_NEED_MULTIPLE_NODES
191 ptr = alloc_bootmem_pages(size);
192#else
Mike Travis3461b0a2008-05-12 21:21:13 +0200193 int node = early_cpu_to_node(cpu);
Mike Travisb447a462008-03-25 15:06:51 -0700194 if (!node_online(node) || !NODE_DATA(node)) {
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300195 ptr = alloc_bootmem_pages(size);
Mike Travisb447a462008-03-25 15:06:51 -0700196 printk(KERN_INFO
Mike Travis23ca4bb2008-05-12 21:21:12 +0200197 "cpu %d has no node %d or node-local memory\n",
Mike Travis3461b0a2008-05-12 21:21:13 +0200198 cpu, node);
Mike Travisb447a462008-03-25 15:06:51 -0700199 }
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300200 else
201 ptr = alloc_bootmem_pages_node(NODE_DATA(node), size);
202#endif
Mike Travis3461b0a2008-05-12 21:21:13 +0200203 per_cpu_offset(cpu) = ptr - __per_cpu_start;
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300204 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
Mike Travis9f0e8d02008-04-04 18:11:01 -0700205
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300206 }
207
Mike Travis9f248bd2008-05-12 21:21:12 +0200208 printk(KERN_DEBUG "NR_CPUS: %d, nr_cpu_ids: %d, nr_node_ids %d\n",
209 NR_CPUS, nr_cpu_ids, nr_node_ids);
Mike Travis9f0e8d02008-04-04 18:11:01 -0700210
Mike Travisb447a462008-03-25 15:06:51 -0700211 /* Setup percpu data maps */
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300212 setup_per_cpu_maps();
Mike Travis9f0e8d02008-04-04 18:11:01 -0700213
Mike Travis9f248bd2008-05-12 21:21:12 +0200214 /* Setup node to cpumask map */
215 setup_node_to_cpumask_map();
216
Mike Travis9f0e8d02008-04-04 18:11:01 -0700217 /* Setup cpumask_of_cpu map */
218 setup_cpumask_of_cpu();
Glauber de Oliveira Costa4fe29a82008-03-19 14:25:23 -0300219}
220
221#endif
Huang, Yingc45a7072008-06-02 14:26:25 +0800222
223void __init parse_setup_data(void)
224{
225 struct setup_data *data;
226 u64 pa_data;
227
228 if (boot_params.hdr.version < 0x0209)
229 return;
230 pa_data = boot_params.hdr.setup_data;
231 while (pa_data) {
232 data = early_ioremap(pa_data, PAGE_SIZE);
233 switch (data->type) {
Huang, Ying8c5beb52008-06-11 11:33:39 +0800234 case SETUP_E820_EXT:
235 parse_e820_ext(data, pa_data);
236 break;
Huang, Yingc45a7072008-06-02 14:26:25 +0800237 default:
238 break;
239 }
240#ifndef CONFIG_DEBUG_BOOT_PARAMS
241 free_early(pa_data, pa_data+sizeof(*data)+data->len);
242#endif
243 pa_data = data->next;
244 early_iounmap(data, PAGE_SIZE);
245 }
246}
Ingo Molnar2b4fa852008-07-08 11:59:23 +0200247
Mike Travis23ca4bb2008-05-12 21:21:12 +0200248#ifdef X86_64_NUMA
Mike Travis9f248bd2008-05-12 21:21:12 +0200249
250/*
251 * Allocate node_to_cpumask_map based on number of available nodes
252 * Requires node_possible_map to be valid.
253 *
254 * Note: node_to_cpumask() is not valid until after this is done.
255 */
256static void __init setup_node_to_cpumask_map(void)
257{
258 unsigned int node, num = 0;
259 cpumask_t *map;
260
261 /* setup nr_node_ids if not done yet */
262 if (nr_node_ids == MAX_NUMNODES) {
263 for_each_node_mask(node, node_possible_map)
264 num = node;
265 nr_node_ids = num + 1;
266 }
267
268 /* allocate the map */
269 map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t));
270
271 Dprintk(KERN_DEBUG "Node to cpumask map at %p for %d nodes\n",
272 map, nr_node_ids);
273
274 /* node_to_cpumask() will now work */
275 node_to_cpumask_map = map;
276}
277
Mike Travis23ca4bb2008-05-12 21:21:12 +0200278void __cpuinit numa_set_node(int cpu, int node)
279{
280 int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);
281
Mike Travis3461b0a2008-05-12 21:21:13 +0200282 if (cpu_pda(cpu) && node != NUMA_NO_NODE)
Mike Travis7891a242008-05-12 21:21:12 +0200283 cpu_pda(cpu)->nodenumber = node;
284
Mike Travis23ca4bb2008-05-12 21:21:12 +0200285 if (cpu_to_node_map)
286 cpu_to_node_map[cpu] = node;
287
288 else if (per_cpu_offset(cpu))
289 per_cpu(x86_cpu_to_node_map, cpu) = node;
290
291 else
292 Dprintk(KERN_INFO "Setting node for non-present cpu %d\n", cpu);
293}
294
295void __cpuinit numa_clear_node(int cpu)
296{
297 numa_set_node(cpu, NUMA_NO_NODE);
298}
299
Mike Travis9f248bd2008-05-12 21:21:12 +0200300#ifndef CONFIG_DEBUG_PER_CPU_MAPS
301
Mike Travis23ca4bb2008-05-12 21:21:12 +0200302void __cpuinit numa_add_cpu(int cpu)
303{
304 cpu_set(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]);
305}
306
307void __cpuinit numa_remove_cpu(int cpu)
308{
309 cpu_clear(cpu, node_to_cpumask_map[cpu_to_node(cpu)]);
310}
Mike Travis23ca4bb2008-05-12 21:21:12 +0200311
Mike Travis9f248bd2008-05-12 21:21:12 +0200312#else /* CONFIG_DEBUG_PER_CPU_MAPS */
313
314/*
315 * --------- debug versions of the numa functions ---------
316 */
317static void __cpuinit numa_set_cpumask(int cpu, int enable)
318{
319 int node = cpu_to_node(cpu);
320 cpumask_t *mask;
321 char buf[64];
322
323 if (node_to_cpumask_map == NULL) {
324 printk(KERN_ERR "node_to_cpumask_map NULL\n");
325 dump_stack();
326 return;
327 }
328
329 mask = &node_to_cpumask_map[node];
330 if (enable)
331 cpu_set(cpu, *mask);
332 else
333 cpu_clear(cpu, *mask);
334
335 cpulist_scnprintf(buf, sizeof(buf), *mask);
336 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
337 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf);
338 }
339
340void __cpuinit numa_add_cpu(int cpu)
341{
342 numa_set_cpumask(cpu, 1);
343}
344
345void __cpuinit numa_remove_cpu(int cpu)
346{
347 numa_set_cpumask(cpu, 0);
348}
Mike Travis23ca4bb2008-05-12 21:21:12 +0200349
350int cpu_to_node(int cpu)
351{
352 if (early_per_cpu_ptr(x86_cpu_to_node_map)) {
353 printk(KERN_WARNING
354 "cpu_to_node(%d): usage too early!\n", cpu);
355 dump_stack();
356 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
357 }
358 return per_cpu(x86_cpu_to_node_map, cpu);
359}
360EXPORT_SYMBOL(cpu_to_node);
361
Mike Travis9f248bd2008-05-12 21:21:12 +0200362/*
363 * Same function as cpu_to_node() but used if called before the
364 * per_cpu areas are setup.
365 */
Mike Travis23ca4bb2008-05-12 21:21:12 +0200366int early_cpu_to_node(int cpu)
367{
368 if (early_per_cpu_ptr(x86_cpu_to_node_map))
369 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
370
371 if (!per_cpu_offset(cpu)) {
372 printk(KERN_WARNING
373 "early_cpu_to_node(%d): no per_cpu area!\n", cpu);
Mike Travis9f248bd2008-05-12 21:21:12 +0200374 dump_stack();
Mike Travis23ca4bb2008-05-12 21:21:12 +0200375 return NUMA_NO_NODE;
376 }
377 return per_cpu(x86_cpu_to_node_map, cpu);
378}
Mike Travis9f248bd2008-05-12 21:21:12 +0200379
380/*
381 * Returns a pointer to the bitmask of CPUs on Node 'node'.
382 */
383cpumask_t *_node_to_cpumask_ptr(int node)
384{
385 if (node_to_cpumask_map == NULL) {
386 printk(KERN_WARNING
387 "_node_to_cpumask_ptr(%d): no node_to_cpumask_map!\n",
388 node);
389 dump_stack();
390 return &cpu_online_map;
391 }
Vegard Nossum03db1f72008-06-06 16:33:25 +0200392 BUG_ON(node >= nr_node_ids);
Mike Travis9f248bd2008-05-12 21:21:12 +0200393 return &node_to_cpumask_map[node];
394}
395EXPORT_SYMBOL(_node_to_cpumask_ptr);
396
397/*
398 * Returns a bitmask of CPUs on Node 'node'.
399 */
400cpumask_t node_to_cpumask(int node)
401{
402 if (node_to_cpumask_map == NULL) {
403 printk(KERN_WARNING
404 "node_to_cpumask(%d): no node_to_cpumask_map!\n", node);
405 dump_stack();
406 return cpu_online_map;
407 }
Vegard Nossum03db1f72008-06-06 16:33:25 +0200408 BUG_ON(node >= nr_node_ids);
Mike Travis9f248bd2008-05-12 21:21:12 +0200409 return node_to_cpumask_map[node];
410}
411EXPORT_SYMBOL(node_to_cpumask);
412
413/*
414 * --------- end of debug versions of the numa functions ---------
415 */
416
417#endif /* CONFIG_DEBUG_PER_CPU_MAPS */
418
419#endif /* X86_64_NUMA */
Bernhard Walle1ecd2762008-06-20 15:38:22 +0200420
421
422/*
423 * --------- Crashkernel reservation ------------------------------
424 */
425
426static inline unsigned long long get_total_mem(void)
427{
428 unsigned long long total;
429
430 total = max_low_pfn - min_low_pfn;
431#ifdef CONFIG_HIGHMEM
432 total += highend_pfn - highstart_pfn;
433#endif
434
435 return total << PAGE_SHIFT;
436}
437
438#ifdef CONFIG_KEXEC
439void __init reserve_crashkernel(void)
440{
441 unsigned long long total_mem;
442 unsigned long long crash_size, crash_base;
443 int ret;
444
445 total_mem = get_total_mem();
446
447 ret = parse_crashkernel(boot_command_line, total_mem,
448 &crash_size, &crash_base);
449 if (ret == 0 && crash_size > 0) {
450 if (crash_base <= 0) {
451 printk(KERN_INFO "crashkernel reservation failed - "
452 "you have to specify a base address\n");
453 return;
454 }
455
456 if (reserve_bootmem_generic(crash_base, crash_size,
457 BOOTMEM_EXCLUSIVE) < 0) {
458 printk(KERN_INFO "crashkernel reservation failed - "
459 "memory is in use\n");
460 return;
461 }
462
463 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
464 "for crashkernel (System RAM: %ldMB)\n",
465 (unsigned long)(crash_size >> 20),
466 (unsigned long)(crash_base >> 20),
467 (unsigned long)(total_mem >> 20));
468
469 crashk_res.start = crash_base;
470 crashk_res.end = crash_base + crash_size - 1;
471 insert_resource(&iomem_resource, &crashk_res);
472 }
473}
474#else
475void __init reserve_crashkernel(void)
476{}
477#endif
Yinghai Luce97c402008-06-21 20:22:09 -0700478static struct resource standard_io_resources[] = {
479 { .name = "dma1", .start = 0x00, .end = 0x1f,
480 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
481 { .name = "pic1", .start = 0x20, .end = 0x21,
482 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
483 { .name = "timer0", .start = 0x40, .end = 0x43,
484 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
485 { .name = "timer1", .start = 0x50, .end = 0x53,
486 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
487 { .name = "keyboard", .start = 0x60, .end = 0x60,
488 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
489 { .name = "keyboard", .start = 0x64, .end = 0x64,
490 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
491 { .name = "dma page reg", .start = 0x80, .end = 0x8f,
492 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
493 { .name = "pic2", .start = 0xa0, .end = 0xa1,
494 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
495 { .name = "dma2", .start = 0xc0, .end = 0xdf,
496 .flags = IORESOURCE_BUSY | IORESOURCE_IO },
497 { .name = "fpu", .start = 0xf0, .end = 0xff,
498 .flags = IORESOURCE_BUSY | IORESOURCE_IO }
499};
500
501void __init reserve_standard_io_resources(void)
502{
503 int i;
504
505 /* request I/O space for devices used on all i[345]86 PCs */
506 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
507 request_resource(&ioport_resource, &standard_io_resources[i]);
508
509}
Bernhard Walle1ecd2762008-06-20 15:38:22 +0200510
Yinghai Lu17b4cce2008-06-21 21:02:20 -0700511#ifdef CONFIG_PROC_VMCORE
512/* elfcorehdr= specifies the location of elf core header
513 * stored by the crashed kernel. This option will be passed
514 * by kexec loader to the capture kernel.
515 */
516static int __init setup_elfcorehdr(char *arg)
517{
518 char *end;
519 if (!arg)
520 return -EINVAL;
521 elfcorehdr_addr = memparse(arg, &end);
522 return end > arg ? 0 : -EINVAL;
523}
524early_param("elfcorehdr", setup_elfcorehdr);
525#endif
526
527
528