linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / ia64 / mm / contig.c
index d79be8e..acaaec4 100644 (file)
 #include <linux/efi.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
-#include <linux/module.h>
 
 #include <asm/meminit.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/sections.h>
+#include <asm/mca.h>
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 static unsigned long num_dma_physpages;
@@ -61,11 +61,10 @@ show_mem (void)
        printk("%d reserved pages\n", reserved);
        printk("%d pages shared\n", shared);
        printk("%d pages swap cached\n", cached);
-       printk("%ld pages in page table cache\n", pgtable_cache_size);
+       printk("%ld pages in page table cache\n",
+               pgtable_quicklist_total_size());
 }
 
-EXPORT_SYMBOL_GPL(show_mem);
-
 /* physical address where the bootmem map is located */
 unsigned long bootmap_start;
 
@@ -217,8 +216,8 @@ count_dma_pages (u64 start, u64 end, void *arg)
 {
        unsigned long *count = arg;
 
-       if (end <= MAX_DMA_ADDRESS)
-               *count += (end - start) >> PAGE_SHIFT;
+       if (start < MAX_DMA_ADDRESS)
+               *count += (min(end, MAX_DMA_ADDRESS) - start) >> PAGE_SHIFT;
        return 0;
 }
 #endif
@@ -270,7 +269,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;
@@ -282,8 +281,8 @@ paging_init (void)
                vmem_map = (struct page *) vmalloc_end;
                efi_memmap_walk(create_mem_map_page_table, NULL);
 
-               mem_map = contig_page_data.node_mem_map = vmem_map;
-               free_area_init_node(0, &contig_page_data, zones_size,
+               NODE_DATA(0)->node_mem_map = vmem_map;
+               free_area_init_node(0, NODE_DATA(0), zones_size,
                                    0, zholes_size);
 
                printk("Virtual mem_map starts at 0x%p\n", mem_map);