x86: clean up reserve_bootmem_generic() and port it to 32-bit
[linux-2.6-microblaze.git] / arch / x86 / mm / init_32.c
index de236e4..abadb1d 100644 (file)
@@ -289,7 +289,8 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
 
 void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 {
-       if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
+       if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn)) &&
+           !page_is_reserved_early(pfn)) {
                ClearPageReserved(page);
                init_page_count(page);
                __free_page(page);
@@ -438,8 +439,6 @@ void zap_low_mappings(void)
 {
        int i;
 
-       save_pg_dir();
-
        /*
         * Zap initial low-memory mappings.
         *
@@ -663,16 +662,8 @@ void __init mem_init(void)
                test_wp_bit();
 
        cpa_init();
-
-       /*
-        * Subtle. SMP is doing it's boot stuff late (because it has to
-        * fork idle threads) - but it also needs low mappings for the
-        * protected-mode entry to work. We zap these entries only after
-        * the WP-bit has been tested.
-        */
-#ifndef CONFIG_SMP
+       save_pg_dir();
        zap_low_mappings();
-#endif
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG
@@ -794,3 +785,9 @@ void free_initrd_mem(unsigned long start, unsigned long end)
        free_init_pages("initrd memory", start, end);
 }
 #endif
+
+int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
+                                  int flags)
+{
+       return reserve_bootmem(phys, len, flags);
+}