This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ia64 / mm / contig.c
index f1fa999..84fd1c1 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/efi.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
-#include <linux/module.h>
 
 #include <asm/meminit.h>
 #include <asm/pgalloc.h>
@@ -66,8 +65,6 @@ show_mem (void)
                pgtable_quicklist_total_size());
 }
 
-EXPORT_SYMBOL_GPL(show_mem);
-
 /* physical address where the bootmem map is located */
 unsigned long bootmap_start;
 
@@ -100,7 +97,7 @@ find_max_pfn (unsigned long start, unsigned long end, void *arg)
  * Find a place to put the bootmap and return its starting address in
  * bootmap_start.  This address must be page-aligned.
  */
-int
+static int __init
 find_bootmap_location (unsigned long start, unsigned long end, void *arg)
 {
        unsigned long needed = *(unsigned long *)arg;
@@ -144,7 +141,7 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg)
  * Walk the EFI memory map and find usable memory for the system, taking
  * into account reserved areas.
  */
-void
+void __init
 find_memory (void)
 {
        unsigned long bootmap_size;
@@ -179,18 +176,20 @@ find_memory (void)
  *
  * Allocate and setup per-cpu data areas.
  */
-void *
+void * __cpuinit
 per_cpu_init (void)
 {
        void *cpu_data;
        int cpu;
+       static int first_time=1;
 
        /*
         * get_free_pages() cannot be used before cpu_init() done.  BSP
         * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls
         * get_zeroed_page().
         */
-       if (smp_processor_id() == 0) {
+       if (first_time) {
+               first_time=0;
                cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
                                           PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
                for (cpu = 0; cpu < NR_CPUS; cpu++) {
@@ -229,7 +228,7 @@ count_dma_pages (u64 start, u64 end, void *arg)
  * Set up the page tables.
  */
 
-void
+void __init
 paging_init (void)
 {
        unsigned long max_dma;
@@ -272,7 +271,7 @@ paging_init (void)
        efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
        if (max_gap < LARGE_GAP) {
                vmem_map = (struct page *) 0;
-               free_area_init_node(0, &contig_page_data, zones_size, 0,
+               free_area_init_node(0, NODE_DATA(0), zones_size, 0,
                                    zholes_size);
        } else {
                unsigned long map_size;
@@ -285,7 +284,7 @@ paging_init (void)
                efi_memmap_walk(create_mem_map_page_table, NULL);
 
                NODE_DATA(0)->node_mem_map = vmem_map;
-               free_area_init_node(0, &contig_page_data, zones_size,
+               free_area_init_node(0, NODE_DATA(0), zones_size,
                                    0, zholes_size);
 
                printk("Virtual mem_map starts at 0x%p\n", mem_map);