]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/setup.c
Merge branch 'linus' into WIP.x86/boot, to fix up conflicts and to pick up updates
[karo-tx-linux.git] / arch / x86 / kernel / setup.c
index 4bf0c8926a1c061bb22c1973962a0d668bfa3d98..cab13f75908b63e43d8bb139441d6c8ca01a18ae 100644 (file)
@@ -75,7 +75,7 @@
 #include <asm/mtrr.h>
 #include <asm/apic.h>
 #include <asm/realmode.h>
-#include <asm/e820.h>
+#include <asm/e820/api.h>
 #include <asm/mpspec.h>
 #include <asm/setup.h>
 #include <asm/efi.h>
  * max_low_pfn_mapped: highest direct mapped pfn under 4GB
  * max_pfn_mapped:     highest direct mapped pfn over 4GB
  *
- * The direct mapping only covers E820_RAM regions, so the ranges and gaps are
+ * The direct mapping only covers E820_TYPE_RAM regions, so the ranges and gaps are
  * represented by pfn_mapped
  */
 unsigned long max_low_pfn_mapped;
@@ -426,7 +426,7 @@ static void __init parse_setup_data(void)
 
                switch (data_type) {
                case SETUP_E820_EXT:
-                       parse_e820_ext(pa_data, data_len);
+                       e820__memory_setup_extended(pa_data, data_len);
                        break;
                case SETUP_DTB:
                        add_dtb(pa_data);
@@ -441,29 +441,6 @@ static void __init parse_setup_data(void)
        }
 }
 
-static void __init e820_reserve_setup_data(void)
-{
-       struct setup_data *data;
-       u64 pa_data;
-
-       pa_data = boot_params.hdr.setup_data;
-       if (!pa_data)
-               return;
-
-       while (pa_data) {
-               data = early_memremap(pa_data, sizeof(*data));
-               e820_update_range(pa_data, sizeof(*data)+data->len,
-                        E820_RAM, E820_RESERVED_KERN);
-               pa_data = data->next;
-               early_memunmap(data, sizeof(*data));
-       }
-
-       sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map);
-       memcpy(e820_saved, e820, sizeof(struct e820map));
-       printk(KERN_INFO "extended physical RAM map:\n");
-       e820_print_map("reserve setup_data");
-}
-
 static void __init memblock_x86_reserve_range_setup_data(void)
 {
        struct setup_data *data;
@@ -756,16 +733,16 @@ static void __init trim_bios_range(void)
         * since some BIOSes are known to corrupt low memory.  See the
         * Kconfig help text for X86_RESERVE_LOW.
         */
-       e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
+       e820__range_update(0, PAGE_SIZE, E820_TYPE_RAM, E820_TYPE_RESERVED);
 
        /*
         * special case: Some BIOSen report the PC BIOS
         * area (640->1Mb) as ram even though it is not.
         * take them out.
         */
-       e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1);
+       e820__range_remove(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_TYPE_RAM, 1);
 
-       sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map);
+       e820__update_table(e820_table);
 }
 
 /* called before trim_bios_range() to spare extra sanitize */
@@ -775,18 +752,18 @@ static void __init e820_add_kernel_range(void)
        u64 size = __pa_symbol(_end) - start;
 
        /*
-        * Complain if .text .data and .bss are not marked as E820_RAM and
+        * Complain if .text .data and .bss are not marked as E820_TYPE_RAM and
         * attempt to fix it by adding the range. We may have a confused BIOS,
         * or the user may have used memmap=exactmap or memmap=xxM$yyM to
         * exclude kernel range. If we really are running on top non-RAM,
         * we will crash later anyways.
         */
-       if (e820_all_mapped(start, start + size, E820_RAM))
+       if (e820__mapped_all(start, start + size, E820_TYPE_RAM))
                return;
 
-       pr_warn(".text .data .bss are not marked as E820_RAM!\n");
-       e820_remove_range(start, size, E820_RAM, 0);
-       e820_add_region(start, size, E820_RAM);
+       pr_warn(".text .data .bss are not marked as E820_TYPE_RAM!\n");
+       e820__range_remove(start, size, E820_TYPE_RAM, 0);
+       e820__range_add(start, size, E820_TYPE_RAM);
 }
 
 static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
@@ -939,7 +916,7 @@ void __init setup_arch(char **cmdline_p)
        x86_init.oem.arch_setup();
 
        iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
-       setup_memory_map();
+       e820__memory_setup();
        parse_setup_data();
 
        copy_edd();
@@ -1028,9 +1005,8 @@ void __init setup_arch(char **cmdline_p)
                early_dump_pci_devices();
 #endif
 
-       /* update the e820_saved too */
-       e820_reserve_setup_data();
-       finish_e820_parsing();
+       e820__reserve_setup_data();
+       e820__finish_early_params();
 
        if (efi_enabled(EFI_BOOT))
                efi_init();
@@ -1056,11 +1032,11 @@ void __init setup_arch(char **cmdline_p)
        trim_bios_range();
 #ifdef CONFIG_X86_32
        if (ppro_with_ram_bug()) {
-               e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,
-                                 E820_RESERVED);
-               sanitize_e820_map(e820->map, ARRAY_SIZE(e820->map), &e820->nr_map);
+               e820__range_update(0x70000000ULL, 0x40000ULL, E820_TYPE_RAM,
+                                 E820_TYPE_RESERVED);
+               e820__update_table(e820_table);
                printk(KERN_INFO "fixed physical RAM map:\n");
-               e820_print_map("bad_ppro");
+               e820__print_table("bad_ppro");
        }
 #else
        early_gart_iommu_check();
@@ -1070,12 +1046,12 @@ void __init setup_arch(char **cmdline_p)
         * partially used pages are not usable - thus
         * we are rounding upwards:
         */
-       max_pfn = e820_end_of_ram_pfn();
+       max_pfn = e820__end_of_ram_pfn();
 
        /* update e820 for memory not covered by WB MTRRs */
        mtrr_bp_init();
        if (mtrr_trim_uncached_memory(max_pfn))
-               max_pfn = e820_end_of_ram_pfn();
+               max_pfn = e820__end_of_ram_pfn();
 
        max_possible_pfn = max_pfn;
 
@@ -1094,7 +1070,7 @@ void __init setup_arch(char **cmdline_p)
        /* How many end-of-memory variables you have, grandma! */
        /* need this before calling reserve_initrd */
        if (max_pfn > (1UL<<(32 - PAGE_SHIFT)))
-               max_low_pfn = e820_end_of_low_ram_pfn();
+               max_low_pfn = e820__end_of_low_ram_pfn();
        else
                max_low_pfn = max_pfn;
 
@@ -1111,7 +1087,7 @@ void __init setup_arch(char **cmdline_p)
        early_alloc_pgt_buf();
 
        /*
-        * Need to conclude brk, before memblock_x86_fill()
+        * Need to conclude brk, before e820__memblock_setup()
         *  it could use memblock_find_in_range, could overlap with
         *  brk area.
         */
@@ -1120,7 +1096,7 @@ void __init setup_arch(char **cmdline_p)
        cleanup_highmap();
 
        memblock_set_current_limit(ISA_END_ADDRESS);
-       memblock_x86_fill();
+       e820__memblock_setup();
 
        reserve_bios_regions();
 
@@ -1137,7 +1113,7 @@ void __init setup_arch(char **cmdline_p)
        }
 
        /* preallocate 4k for mptable mpc */
-       early_reserve_e820_mpc_new();
+       e820__memblock_alloc_reserved_mpc_new();
 
 #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
        setup_bios_corruption_check();
@@ -1275,12 +1251,12 @@ void __init setup_arch(char **cmdline_p)
 
        kvm_guest_init();
 
-       e820_reserve_resources();
-       e820_mark_nosave_regions(max_low_pfn);
+       e820__reserve_resources();
+       e820__register_nosave_regions(max_low_pfn);
 
        x86_init.resources.reserve_resources();
 
-       e820_setup_gap();
+       e820__setup_pci_gap();
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)