include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / arch / parisc / mm / init.c
index 4356ceb..f4f4d70 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
+#include <linux/gfp.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/pci.h>         /* for hppa_dma_ops and pcxl_dma_ops */
@@ -370,34 +371,22 @@ static void __init setup_bootmem(void)
 
 void free_initmem(void)
 {
-       unsigned long addr, init_begin, init_end;
-
-       printk(KERN_INFO "Freeing unused kernel memory: ");
+       unsigned long addr;
+       unsigned long init_begin = (unsigned long)__init_begin;
+       unsigned long init_end = (unsigned long)__init_end;
 
 #ifdef CONFIG_DEBUG_KERNEL
        /* Attempt to catch anyone trying to execute code here
         * by filling the page with BRK insns.
-        * 
-        * If we disable interrupts for all CPUs, then IPI stops working.
-        * Kinda breaks the global cache flushing.
         */
-       local_irq_disable();
-
-       memset(__init_begin, 0x00,
-               (unsigned long)__init_end - (unsigned long)__init_begin);
-
-       flush_data_cache();
-       asm volatile("sync" : : );
-       flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end);
-       asm volatile("sync" : : );
-
-       local_irq_enable();
+       memset((void *)init_begin, 0x00, init_end - init_begin);
+       flush_icache_range(init_begin, init_end);
 #endif
        
        /* align __init_begin and __init_end to page size,
           ignoring linker script where we might have tried to save RAM */
-       init_begin = PAGE_ALIGN((unsigned long)(__init_begin));
-       init_end   = PAGE_ALIGN((unsigned long)(__init_end));
+       init_begin = PAGE_ALIGN(init_begin);
+       init_end = PAGE_ALIGN(init_end);
        for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {
                ClearPageReserved(virt_to_page(addr));
                init_page_count(virt_to_page(addr));
@@ -409,7 +398,8 @@ void free_initmem(void)
        /* set up a new led state on systems shipped LED State panel */
        pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
        
-       printk("%luk freed\n", (init_end - init_begin) >> 10);
+       printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n",
+               (init_end - init_begin) >> 10);
 }
 
 
@@ -445,8 +435,8 @@ void mark_rodata_ro(void)
 #define SET_MAP_OFFSET(x) ((void *)(((unsigned long)(x) + VM_MAP_OFFSET) \
                                     & ~(VM_MAP_OFFSET-1)))
 
-void *vmalloc_start __read_mostly;
-EXPORT_SYMBOL(vmalloc_start);
+void *parisc_vmalloc_start __read_mostly;
+EXPORT_SYMBOL(parisc_vmalloc_start);
 
 #ifdef CONFIG_PA11
 unsigned long pcxl_dma_start __read_mostly;
@@ -507,17 +497,18 @@ void __init mem_init(void)
 #ifdef CONFIG_PA11
        if (hppa_dma_ops == &pcxl_dma_ops) {
                pcxl_dma_start = (unsigned long)SET_MAP_OFFSET(MAP_START);
-               vmalloc_start = SET_MAP_OFFSET(pcxl_dma_start + PCXL_DMA_MAP_SIZE);
+               parisc_vmalloc_start = SET_MAP_OFFSET(pcxl_dma_start
+                                               + PCXL_DMA_MAP_SIZE);
        } else {
                pcxl_dma_start = 0;
-               vmalloc_start = SET_MAP_OFFSET(MAP_START);
+               parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
        }
 #else
-       vmalloc_start = SET_MAP_OFFSET(MAP_START);
+       parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
 #endif
 
        printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
-               (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
+               nr_free_pages() << (PAGE_SHIFT-10),
                num_physpages << (PAGE_SHIFT-10),
                codesize >> 10,
                reservedpages << (PAGE_SHIFT-10),