2 * linux/arch/i386/kernel/setup.c
4 * Copyright (C) 1995 Linus Torvalds
6 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
8 * Memory region support
9 * David Parsons <orc@pell.chi.il.us>, July-August 1999
11 * Added E820 sanitization routine (removes overlapping memory regions);
12 * Brian Moyle <bmoyle@mvista.com>, February 2001
14 * Moved CPU detection code to cpu/${cpu}.c
15 * Patrick Mochel <mochel@osdl.org>, March 2002
17 * Provisions for empty E820 memory regions (reported by certain BIOSes).
18 * Alex Achenbach <xela@slit.de>, December 2002.
23 * This file handles the architecture-dependent parts of initialization
26 #include <linux/sched.h>
28 #include <linux/mmzone.h>
29 #include <linux/screen_info.h>
30 #include <linux/ioport.h>
31 #include <linux/acpi.h>
32 #include <linux/apm_bios.h>
33 #include <linux/initrd.h>
34 #include <linux/bootmem.h>
35 #include <linux/seq_file.h>
36 #include <linux/platform_device.h>
37 #include <linux/console.h>
38 #include <linux/mca.h>
39 #include <linux/root_dev.h>
40 #include <linux/highmem.h>
41 #include <linux/module.h>
42 #include <linux/efi.h>
43 #include <linux/init.h>
44 #include <linux/edd.h>
45 #include <linux/nodemask.h>
46 #include <linux/kexec.h>
47 #include <linux/crash_dump.h>
48 #include <linux/dmi.h>
49 #include <linux/pfn.h>
51 #include <video/edid.h>
55 #include <asm/mpspec.h>
56 #include <asm/mmzone.h>
57 #include <asm/setup.h>
58 #include <asm/arch_hooks.h>
59 #include <asm/sections.h>
60 #include <asm/io_apic.h>
63 #include <setup_arch.h>
64 #include <bios_ebda.h>
66 /* This value is set up by the early boot code to point to the value
67 immediately after the boot time page tables. It contains a *physical*
68 address, and must not be in the .bss segment! */
69 unsigned long init_pg_tables_end __initdata = ~0UL;
71 int disable_pse __devinitdata = 0;
76 extern struct e820map e820;
77 extern struct resource code_resource;
78 extern struct resource data_resource;
80 /* cpu data as detected by the assembly code in head.S */
81 struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
82 /* common cpu data for all cpus */
83 struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
84 EXPORT_SYMBOL(boot_cpu_data);
86 unsigned long mmu_cr4_features;
88 /* for MCA, but anyone else can use it if they want */
89 unsigned int machine_id;
91 EXPORT_SYMBOL(machine_id);
93 unsigned int machine_submodel_id;
94 unsigned int BIOS_revision;
95 unsigned int mca_pentium_flag;
97 /* For PCI or other memory-mapped resources */
98 unsigned long pci_mem_start = 0x10000000;
100 EXPORT_SYMBOL(pci_mem_start);
103 /* Boot loader ID as an integer, for the benefit of proc_dointvec */
106 /* user-defined highmem size */
107 static unsigned int highmem_pages = -1;
112 struct drive_info_struct { char dummy[32]; } drive_info;
113 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || \
114 defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
115 EXPORT_SYMBOL(drive_info);
117 struct screen_info screen_info;
118 EXPORT_SYMBOL(screen_info);
119 struct apm_info apm_info;
120 EXPORT_SYMBOL(apm_info);
121 struct sys_desc_table_struct {
122 unsigned short length;
123 unsigned char table[0];
125 struct edid_info edid_info;
126 EXPORT_SYMBOL_GPL(edid_info);
127 struct ist_info ist_info;
128 #if defined(CONFIG_X86_SPEEDSTEP_SMI) || \
129 defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
130 EXPORT_SYMBOL(ist_info);
133 extern void early_cpu_init(void);
134 extern int root_mountflags;
136 unsigned long saved_videomode;
138 #define RAMDISK_IMAGE_START_MASK 0x07FF
139 #define RAMDISK_PROMPT_FLAG 0x8000
140 #define RAMDISK_LOAD_FLAG 0x4000
142 static char command_line[COMMAND_LINE_SIZE];
144 unsigned char __initdata boot_params[PARAM_SIZE];
146 static void __init limit_regions(unsigned long long size)
148 unsigned long long current_addr = 0;
152 efi_memory_desc_t *md;
155 for (p = memmap.map, i = 0; p < memmap.map_end;
156 p += memmap.desc_size, i++) {
158 current_addr = md->phys_addr + (md->num_pages << 12);
159 if (md->type == EFI_CONVENTIONAL_MEMORY) {
160 if (current_addr >= size) {
162 (((current_addr-size) + PAGE_SIZE-1) >> PAGE_SHIFT);
163 memmap.nr_map = i + 1;
169 for (i = 0; i < e820.nr_map; i++) {
170 current_addr = e820.map[i].addr + e820.map[i].size;
171 if (current_addr < size)
174 if (e820.map[i].type != E820_RAM)
177 if (e820.map[i].addr >= size) {
179 * This region starts past the end of the
180 * requested size, skip it completely.
185 e820.map[i].size -= current_addr - size;
193 static void __init print_memory_map(char *who)
197 for (i = 0; i < e820.nr_map; i++) {
198 printk(" %s: %016Lx - %016Lx ", who,
200 e820.map[i].addr + e820.map[i].size);
201 switch (e820.map[i].type) {
202 case E820_RAM: printk("(usable)\n");
205 printk("(reserved)\n");
208 printk("(ACPI data)\n");
211 printk("(ACPI NVS)\n");
213 default: printk("type %lu\n", e820.map[i].type);
219 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
221 #ifdef CONFIG_EDD_MODULE
225 * copy_edd() - Copy the BIOS EDD information
226 * from boot_params into a safe place.
229 static inline void copy_edd(void)
231 memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature));
232 memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info));
233 edd.mbr_signature_nr = EDD_MBR_SIG_NR;
234 edd.edd_info_nr = EDD_NR;
237 static inline void copy_edd(void)
242 static int __initdata user_defined_memmap = 0;
245 * "mem=nopentium" disables the 4MB page tables.
246 * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM
247 * to <mem>, overriding the bios size.
248 * "memmap=XXX[KkmM]@XXX[KkmM]" defines a memory region from
249 * <start> to <start>+<mem>, overriding the bios size.
251 * HPA tells me bootloaders need to parse mem=, so no new
252 * option should be mem= [also see Documentation/i386/boot.txt]
254 static int __init parse_mem(char *arg)
259 if (strcmp(arg, "nopentium") == 0) {
260 clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability);
263 /* If the user specifies memory size, we
264 * limit the BIOS-provided memory map to
265 * that size. exactmap can be used to specify
266 * the exact map. mem=number can be used to
267 * trim the existing memory map.
269 unsigned long long mem_size;
271 mem_size = memparse(arg, &arg);
272 limit_regions(mem_size);
273 user_defined_memmap = 1;
277 early_param("mem", parse_mem);
279 static int __init parse_memmap(char *arg)
284 if (strcmp(arg, "exactmap") == 0) {
285 #ifdef CONFIG_CRASH_DUMP
286 /* If we are doing a crash dump, we
287 * still need to know the real mem
288 * size before original memory map is
292 saved_max_pfn = max_pfn;
295 user_defined_memmap = 1;
297 /* If the user specifies memory size, we
298 * limit the BIOS-provided memory map to
299 * that size. exactmap can be used to specify
300 * the exact map. mem=number can be used to
301 * trim the existing memory map.
303 unsigned long long start_at, mem_size;
305 mem_size = memparse(arg, &arg);
307 start_at = memparse(arg+1, &arg);
308 add_memory_region(start_at, mem_size, E820_RAM);
309 } else if (*arg == '#') {
310 start_at = memparse(arg+1, &arg);
311 add_memory_region(start_at, mem_size, E820_ACPI);
312 } else if (*arg == '$') {
313 start_at = memparse(arg+1, &arg);
314 add_memory_region(start_at, mem_size, E820_RESERVED);
316 limit_regions(mem_size);
317 user_defined_memmap = 1;
322 early_param("memmap", parse_memmap);
324 #ifdef CONFIG_PROC_VMCORE
325 /* elfcorehdr= specifies the location of elf core header
326 * stored by the crashed kernel.
328 static int __init parse_elfcorehdr(char *arg)
333 elfcorehdr_addr = memparse(arg, &arg);
336 early_param("elfcorehdr", parse_elfcorehdr);
337 #endif /* CONFIG_PROC_VMCORE */
340 * highmem=size forces highmem to be exactly 'size' bytes.
341 * This works even on boxes that have no highmem otherwise.
342 * This also works to reduce highmem size on bigger boxes.
344 static int __init parse_highmem(char *arg)
349 highmem_pages = memparse(arg, &arg) >> PAGE_SHIFT;
352 early_param("highmem", parse_highmem);
355 * vmalloc=size forces the vmalloc area to be exactly 'size'
356 * bytes. This can be used to increase (or decrease) the
357 * vmalloc area - the default is 128m.
359 static int __init parse_vmalloc(char *arg)
364 __VMALLOC_RESERVE = memparse(arg, &arg);
367 early_param("vmalloc", parse_vmalloc);
370 * reservetop=size reserves a hole at the top of the kernel address space which
371 * a hypervisor can load into later. Needed for dynamically loaded hypervisors,
372 * so relocating the fixmap can be done before paging initialization.
374 static int __init parse_reservetop(char *arg)
376 unsigned long address;
381 address = memparse(arg, &arg);
382 reserve_top_address(address);
385 early_param("reservetop", parse_reservetop);
388 * This function checks if the entire range <start,end> is mapped with type.
390 * Note: this function only works correct if the e820 table is sorted and
391 * not-overlapping, which is the case
394 e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
399 for (i = 0; i < e820.nr_map; i++) {
400 struct e820entry *ei = &e820.map[i];
401 if (type && ei->type != type)
403 /* is the region (part) in overlap with the current region ?*/
404 if (ei->addr >= end || ei->addr + ei->size <= start)
406 /* if the region is at the beginning of <start,end> we move
407 * start to the end of the region since it's ok until there
409 if (ei->addr <= start)
410 start = ei->addr + ei->size;
411 /* if start is now at or beyond end, we're done, full
414 return 1; /* we're done */
420 * Determine low and high memory ranges:
422 unsigned long __init find_max_low_pfn(void)
424 unsigned long max_low_pfn;
426 max_low_pfn = max_pfn;
427 if (max_low_pfn > MAXMEM_PFN) {
428 if (highmem_pages == -1)
429 highmem_pages = max_pfn - MAXMEM_PFN;
430 if (highmem_pages + MAXMEM_PFN < max_pfn)
431 max_pfn = MAXMEM_PFN + highmem_pages;
432 if (highmem_pages + MAXMEM_PFN > max_pfn) {
433 printk("only %luMB highmem pages available, ignoring highmem size of %uMB.\n", pages_to_mb(max_pfn - MAXMEM_PFN), pages_to_mb(highmem_pages));
436 max_low_pfn = MAXMEM_PFN;
437 #ifndef CONFIG_HIGHMEM
438 /* Maximum memory usable is what is directly addressable */
439 printk(KERN_WARNING "Warning only %ldMB will be used.\n",
441 if (max_pfn > MAX_NONPAE_PFN)
442 printk(KERN_WARNING "Use a PAE enabled kernel.\n");
444 printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
445 max_pfn = MAXMEM_PFN;
446 #else /* !CONFIG_HIGHMEM */
447 #ifndef CONFIG_X86_PAE
448 if (max_pfn > MAX_NONPAE_PFN) {
449 max_pfn = MAX_NONPAE_PFN;
450 printk(KERN_WARNING "Warning only 4GB will be used.\n");
451 printk(KERN_WARNING "Use a PAE enabled kernel.\n");
453 #endif /* !CONFIG_X86_PAE */
454 #endif /* !CONFIG_HIGHMEM */
456 if (highmem_pages == -1)
458 #ifdef CONFIG_HIGHMEM
459 if (highmem_pages >= max_pfn) {
460 printk(KERN_ERR "highmem size specified (%uMB) is bigger than pages available (%luMB)!.\n", pages_to_mb(highmem_pages), pages_to_mb(max_pfn));
464 if (max_low_pfn-highmem_pages < 64*1024*1024/PAGE_SIZE){
465 printk(KERN_ERR "highmem size %uMB results in smaller than 64MB lowmem, ignoring it.\n", pages_to_mb(highmem_pages));
468 max_low_pfn -= highmem_pages;
472 printk(KERN_ERR "ignoring highmem size on non-highmem kernel!\n");
479 * Free all available memory for boot time allocation. Used
480 * as a callback function by efi_memory_walk()
484 free_available_memory(unsigned long start, unsigned long end, void *arg)
486 /* check max_low_pfn */
487 if (start >= (max_low_pfn << PAGE_SHIFT))
489 if (end >= (max_low_pfn << PAGE_SHIFT))
490 end = max_low_pfn << PAGE_SHIFT;
492 free_bootmem(start, end - start);
497 * Register fully available low RAM pages with the bootmem allocator.
499 static void __init register_bootmem_low_pages(unsigned long max_low_pfn)
504 efi_memmap_walk(free_available_memory, NULL);
507 for (i = 0; i < e820.nr_map; i++) {
508 unsigned long curr_pfn, last_pfn, size;
510 * Reserve usable low memory
512 if (e820.map[i].type != E820_RAM)
515 * We are rounding up the start address of usable memory:
517 curr_pfn = PFN_UP(e820.map[i].addr);
518 if (curr_pfn >= max_low_pfn)
521 * ... and at the end of the usable range downwards:
523 last_pfn = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
525 if (last_pfn > max_low_pfn)
526 last_pfn = max_low_pfn;
529 * .. finally, did all the rounding and playing
530 * around just make the area go away?
532 if (last_pfn <= curr_pfn)
535 size = last_pfn - curr_pfn;
536 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size));
541 * workaround for Dell systems that neglect to reserve EBDA
543 static void __init reserve_ebda_region(void)
546 addr = get_bios_ebda();
548 reserve_bootmem(addr, PAGE_SIZE);
551 #ifndef CONFIG_NEED_MULTIPLE_NODES
552 void __init setup_bootmem_allocator(void);
553 static unsigned long __init setup_memory(void)
556 * partially used pages are not usable - thus
557 * we are rounding upwards:
559 min_low_pfn = PFN_UP(init_pg_tables_end);
563 max_low_pfn = find_max_low_pfn();
565 #ifdef CONFIG_HIGHMEM
566 highstart_pfn = highend_pfn = max_pfn;
567 if (max_pfn > max_low_pfn) {
568 highstart_pfn = max_low_pfn;
570 printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
571 pages_to_mb(highend_pfn - highstart_pfn));
572 num_physpages = highend_pfn;
573 high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
575 num_physpages = max_low_pfn;
576 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
578 #ifdef CONFIG_FLATMEM
579 max_mapnr = num_physpages;
581 printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
582 pages_to_mb(max_low_pfn));
584 setup_bootmem_allocator();
589 void __init zone_sizes_init(void)
591 unsigned long max_zone_pfns[MAX_NR_ZONES];
592 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
593 max_zone_pfns[ZONE_DMA] =
594 virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
595 max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
596 #ifdef CONFIG_HIGHMEM
597 max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
598 add_active_range(0, 0, highend_pfn);
600 add_active_range(0, 0, max_low_pfn);
603 free_area_init_nodes(max_zone_pfns);
606 extern unsigned long __init setup_memory(void);
607 extern void zone_sizes_init(void);
608 #endif /* !CONFIG_NEED_MULTIPLE_NODES */
610 void __init setup_bootmem_allocator(void)
612 unsigned long bootmap_size;
614 * Initialize the boot-time allocator (with low memory only):
616 bootmap_size = init_bootmem(min_low_pfn, max_low_pfn);
618 register_bootmem_low_pages(max_low_pfn);
621 * Reserve the bootmem bitmap itself as well. We do this in two
622 * steps (first step was init_bootmem()) because this catches
623 * the (very unlikely) case of us accidentally initializing the
624 * bootmem allocator with an invalid RAM area.
626 reserve_bootmem(__pa_symbol(_text), (PFN_PHYS(min_low_pfn) +
627 bootmap_size + PAGE_SIZE-1) - __pa_symbol(_text));
630 * reserve physical page 0 - it's a special BIOS page on many boxes,
631 * enabling clean reboots, SMP operation, laptop functions.
633 reserve_bootmem(0, PAGE_SIZE);
635 /* reserve EBDA region, it's a 4K region */
636 reserve_ebda_region();
638 /* could be an AMD 768MPX chipset. Reserve a page before VGA to prevent
639 PCI prefetch into it (errata #56). Usually the page is reserved anyways,
640 unless you have no PS/2 mouse plugged in. */
641 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
642 boot_cpu_data.x86 == 6)
643 reserve_bootmem(0xa0000 - 4096, 4096);
647 * But first pinch a few for the stack/trampoline stuff
648 * FIXME: Don't need the extra page at 4K, but need to fix
649 * trampoline before removing it. (see the GDT stuff)
651 reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
653 #ifdef CONFIG_ACPI_SLEEP
655 * Reserve low memory region for sleep support.
657 acpi_reserve_bootmem();
659 #ifdef CONFIG_X86_FIND_SMP_CONFIG
661 * Find and reserve possible boot-time SMP configuration:
666 #ifdef CONFIG_BLK_DEV_INITRD
667 if (LOADER_TYPE && INITRD_START) {
668 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
669 reserve_bootmem(INITRD_START, INITRD_SIZE);
671 INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
672 initrd_end = initrd_start+INITRD_SIZE;
675 printk(KERN_ERR "initrd extends beyond end of memory "
676 "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
677 INITRD_START + INITRD_SIZE,
678 max_low_pfn << PAGE_SHIFT);
684 if (crashk_res.start != crashk_res.end)
685 reserve_bootmem(crashk_res.start,
686 crashk_res.end - crashk_res.start + 1);
691 * The node 0 pgdat is initialized before all of these because
692 * it's needed for bootmem. node>0 pgdats have their virtual
693 * space allocated before the pagetables are in place to access
694 * them, so they can't be cleared then.
696 * This should all compile down to nothing when NUMA is off.
698 void __init remapped_pgdat_init(void)
702 for_each_online_node(nid) {
704 memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
710 static void __init register_memory(void)
712 unsigned long gapstart, gapsize, round;
713 unsigned long long last;
717 * Search for the bigest gap in the low 32 bits of the e820
720 last = 0x100000000ull;
721 gapstart = 0x10000000;
725 unsigned long long start = e820.map[i].addr;
726 unsigned long long end = start + e820.map[i].size;
729 * Since "last" is at most 4GB, we know we'll
730 * fit in 32 bits if this condition is true
733 unsigned long gap = last - end;
745 * See how much we want to round up: start off with
746 * rounding to the next 1MB area.
749 while ((gapsize >> 4) > round)
751 /* Fun with two's complement */
752 pci_mem_start = (gapstart + round) & -round;
754 printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n",
755 pci_mem_start, gapstart, gapsize);
759 static void set_mca_bus(int x)
764 static void set_mca_bus(int x) { }
768 * Determine if we were loaded by an EFI loader. If so, then we have also been
769 * passed the efi memmap, systab, etc., so we should use these data structures
770 * for initialization. Note, the efi init code path is determined by the
771 * global efi_enabled. This allows the same kernel image to be used on existing
772 * systems (with a traditional BIOS) as well as on EFI systems.
774 void __init setup_arch(char **cmdline_p)
776 unsigned long max_low_pfn;
778 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
779 pre_setup_arch_hook();
783 * FIXME: This isn't an official loader_type right
784 * now but does currently work with elilo.
785 * If we were configured as an EFI kernel, check to make
786 * sure that we were loaded correctly from elilo and that
787 * the system table is valid. If not, then initialize normally.
790 if ((LOADER_TYPE == 0x50) && EFI_SYSTAB)
794 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
795 drive_info = DRIVE_INFO;
796 screen_info = SCREEN_INFO;
797 edid_info = EDID_INFO;
798 apm_info.bios = APM_BIOS_INFO;
800 saved_videomode = VIDEO_MODE;
801 if( SYS_DESC_TABLE.length != 0 ) {
802 set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2);
803 machine_id = SYS_DESC_TABLE.table[0];
804 machine_submodel_id = SYS_DESC_TABLE.table[1];
805 BIOS_revision = SYS_DESC_TABLE.table[2];
807 bootloader_type = LOADER_TYPE;
809 #ifdef CONFIG_BLK_DEV_RAM
810 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
811 rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
812 rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
818 printk(KERN_INFO "BIOS-provided physical RAM map:\n");
819 print_memory_map(machine_specific_memory_setup());
824 if (!MOUNT_ROOT_RDONLY)
825 root_mountflags &= ~MS_RDONLY;
826 init_mm.start_code = (unsigned long) _text;
827 init_mm.end_code = (unsigned long) _etext;
828 init_mm.end_data = (unsigned long) _edata;
829 init_mm.brk = init_pg_tables_end + PAGE_OFFSET;
831 code_resource.start = virt_to_phys(_text);
832 code_resource.end = virt_to_phys(_etext)-1;
833 data_resource.start = virt_to_phys(_etext);
834 data_resource.end = virt_to_phys(_edata)-1;
838 if (user_defined_memmap) {
839 printk(KERN_INFO "user-defined physical RAM map:\n");
840 print_memory_map("user");
843 strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE);
844 *cmdline_p = command_line;
846 max_low_pfn = setup_memory();
849 * NOTE: before this point _nobody_ is allowed to allocate
850 * any memory using the bootmem allocator. Although the
851 * alloctor is now initialised only the first 8Mb of the kernel
852 * virtual address space has been mapped. All allocations before
853 * paging_init() has completed must use the alloc_bootmem_low_pages()
854 * variant (which allocates DMA'able memory) and care must be taken
855 * not to exceed the 8Mb limit.
859 smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
862 remapped_pgdat_init();
867 * NOTE: at this point the bootmem allocator is fully available.
872 #ifdef CONFIG_X86_GENERICARCH
873 generic_apic_probe();
880 * Parse the ACPI tables for possible boot-time SMP configuration.
882 acpi_boot_table_init();
886 #ifdef CONFIG_X86_IO_APIC
887 check_acpi_pci(); /* Checks more than just ACPI actually */
894 #if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
896 printk(KERN_WARNING "More than 8 CPUs detected and "
897 "CONFIG_X86_PC cannot handle it.\nUse "
898 "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
901 #ifdef CONFIG_X86_LOCAL_APIC
902 if (smp_found_config)
909 #if defined(CONFIG_VGA_CONSOLE)
910 if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
911 conswitchp = &vga_con;
912 #elif defined(CONFIG_DUMMY_CONSOLE)
913 conswitchp = &dummy_con;
919 static __init int add_pcspkr(void)
921 struct platform_device *pd;
924 pd = platform_device_alloc("pcspkr", -1);
928 ret = platform_device_add(pd);
930 platform_device_put(pd);
934 device_initcall(add_pcspkr);