vserver 2.0 rc7
[linux-2.6.git] / arch / i386 / mm / init.c
index fe4e6b7..7a7ea37 100644 (file)
@@ -233,13 +233,10 @@ static inline int page_is_ram(unsigned long pagenr)
 pte_t *kmap_pte;
 pgprot_t kmap_prot;
 
-EXPORT_SYMBOL(kmap_prot);
-EXPORT_SYMBOL(kmap_pte);
-
 #define kmap_get_fixmap_pte(vaddr)                                     \
        pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), vaddr), (vaddr)), (vaddr))
 
-void __init kmap_init(void)
+static void __init kmap_init(void)
 {
        unsigned long kmap_vstart;
 
@@ -250,7 +247,7 @@ void __init kmap_init(void)
        kmap_prot = PAGE_KERNEL;
 }
 
-void __init permanent_kmaps_init(pgd_t *pgd_base)
+static void __init permanent_kmaps_init(pgd_t *pgd_base)
 {
        pgd_t *pgd;
        pud_t *pud;
@@ -281,7 +278,7 @@ void __init one_highpage_init(struct page *page, int pfn, int bad_ppro)
 }
 
 #ifndef CONFIG_DISCONTIGMEM
-void __init set_highmem_pages_init(int bad_ppro) 
+static void __init set_highmem_pages_init(int bad_ppro)
 {
        int pfn;
        for (pfn = highstart_pfn; pfn < highend_pfn; pfn++)
@@ -394,31 +391,6 @@ void zap_low_mappings (void)
        flush_tlb_all();
 }
 
-#ifndef CONFIG_DISCONTIGMEM
-void __init zone_sizes_init(void)
-{
-       unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
-       unsigned int max_dma, high, low;
-       
-       max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
-       low = max_low_pfn;
-       high = highend_pfn;
-       
-       if (low < max_dma)
-               zones_size[ZONE_DMA] = low;
-       else {
-               zones_size[ZONE_DMA] = max_dma;
-               zones_size[ZONE_NORMAL] = low - max_dma;
-#ifdef CONFIG_HIGHMEM
-               zones_size[ZONE_HIGHMEM] = high - low;
-#endif
-       }
-       free_area_init(zones_size);     
-}
-#else
-extern void zone_sizes_init(void);
-#endif /* !CONFIG_DISCONTIGMEM */
-
 static int disable_nx __initdata = 0;
 u64 __supported_pte_mask = ~_PAGE_NX;
 
@@ -519,7 +491,6 @@ void __init paging_init(void)
        __flush_tlb_all();
 
        kmap_init();
-       zone_sizes_init();
 }
 
 /*
@@ -529,7 +500,7 @@ void __init paging_init(void)
  * but fortunately the switch to using exceptions got rid of all that.
  */
 
-void __init test_wp_bit(void)
+static void __init test_wp_bit(void)
 {
        printk("Checking if this processor honours the WP bit even in supervisor mode... ");
 
@@ -548,20 +519,17 @@ void __init test_wp_bit(void)
        }
 }
 
-#ifndef CONFIG_DISCONTIGMEM
 static void __init set_max_mapnr_init(void)
 {
 #ifdef CONFIG_HIGHMEM
-       max_mapnr = num_physpages = highend_pfn;
+       num_physpages = highend_pfn;
 #else
-       max_mapnr = num_physpages = max_low_pfn;
+       num_physpages = max_low_pfn;
+#endif
+#ifndef CONFIG_DISCONTIGMEM
+       max_mapnr = num_physpages;
 #endif
 }
-#define __free_all_bootmem() free_all_bootmem()
-#else
-#define __free_all_bootmem() free_all_bootmem_node(NODE_DATA(0))
-extern void set_max_mapnr_init(void);
-#endif /* !CONFIG_DISCONTIGMEM */
 
 static struct kcore_list kcore_mem, kcore_vmalloc; 
 
@@ -592,13 +560,13 @@ void __init mem_init(void)
        set_max_mapnr_init();
 
 #ifdef CONFIG_HIGHMEM
-       high_memory = (void *) __va(highstart_pfn * PAGE_SIZE);
+       high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
 #else
-       high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
+       high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
 #endif
 
        /* this will put all low memory onto the freelists */
-       totalram_pages += __free_all_bootmem();
+       totalram_pages += free_all_bootmem();
 
        reservedpages = 0;
        for (tmp = 0; tmp < max_low_pfn; tmp++)