aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 5d9e40c5862..3499b4fabc9 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -667,6 +667,23 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
667 {} 667 {}
668}; 668};
669 669
670static void __init trim_bios_range(void)
671{
672 /*
673 * A special case is the first 4Kb of memory;
674 * This is a BIOS owned area, not kernel ram, but generally
675 * not listed as such in the E820 table.
676 */
677 e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
678 /*
679 * special case: Some BIOSen report the PC BIOS
680 * area (640->1Mb) as ram even though it is not.
681 * take them out.
682 */
683 e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1);
684 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
685}
686
670/* 687/*
671 * Determine if we were loaded by an EFI loader. If so, then we have also been 688 * Determine if we were loaded by an EFI loader. If so, then we have also been
672 * passed the efi memmap, systab, etc., so we should use these data structures 689 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -830,7 +847,7 @@ void __init setup_arch(char **cmdline_p)
830 insert_resource(&iomem_resource, &data_resource); 847 insert_resource(&iomem_resource, &data_resource);
831 insert_resource(&iomem_resource, &bss_resource); 848 insert_resource(&iomem_resource, &bss_resource);
832 849
833 850 trim_bios_range();
834#ifdef CONFIG_X86_32 851#ifdef CONFIG_X86_32
835 if (ppro_with_ram_bug()) { 852 if (ppro_with_ram_bug()) {
836 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM, 853 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,