diff options
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index cdb6a8a506dd..f9b1f4e5ab74 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -650,6 +650,23 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = { | |||
650 | {} | 650 | {} |
651 | }; | 651 | }; |
652 | 652 | ||
653 | static void __init trim_bios_range(void) | ||
654 | { | ||
655 | /* | ||
656 | * A special case is the first 4Kb of memory; | ||
657 | * This is a BIOS owned area, not kernel ram, but generally | ||
658 | * not listed as such in the E820 table. | ||
659 | */ | ||
660 | e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED); | ||
661 | /* | ||
662 | * special case: Some BIOSen report the PC BIOS | ||
663 | * area (640->1Mb) as ram even though it is not. | ||
664 | * take them out. | ||
665 | */ | ||
666 | e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); | ||
667 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); | ||
668 | } | ||
669 | |||
653 | /* | 670 | /* |
654 | * Determine if we were loaded by an EFI loader. If so, then we have also been | 671 | * Determine if we were loaded by an EFI loader. If so, then we have also been |
655 | * passed the efi memmap, systab, etc., so we should use these data structures | 672 | * passed the efi memmap, systab, etc., so we should use these data structures |
@@ -813,7 +830,7 @@ void __init setup_arch(char **cmdline_p) | |||
813 | insert_resource(&iomem_resource, &data_resource); | 830 | insert_resource(&iomem_resource, &data_resource); |
814 | insert_resource(&iomem_resource, &bss_resource); | 831 | insert_resource(&iomem_resource, &bss_resource); |
815 | 832 | ||
816 | 833 | trim_bios_range(); | |
817 | #ifdef CONFIG_X86_32 | 834 | #ifdef CONFIG_X86_32 |
818 | if (ppro_with_ram_bug()) { | 835 | if (ppro_with_ram_bug()) { |
819 | e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM, | 836 | e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM, |