Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
[linux-2.6.git] / arch / frv / mm / init.c
index 765088e..0708284 100644 (file)
@@ -16,7 +16,6 @@
  *    - Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/pagemap.h>
@@ -27,6 +26,7 @@
 #include <linux/types.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
+#include <linux/module.h>
 
 #include <asm/setup.h>
 #include <asm/segment.h>
@@ -57,38 +57,9 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
  */
 static unsigned long empty_bad_page_table;
 static unsigned long empty_bad_page;
-unsigned long empty_zero_page;
 
-/*****************************************************************************/
-/*
- *
- */
-void show_mem(void)
-{
-       unsigned long i;
-       int free = 0, total = 0, reserved = 0, shared = 0;
-
-       printk("\nMem-info:\n");
-       show_free_areas();
-       i = max_mapnr;
-       while (i-- > 0) {
-               struct page *page = &mem_map[i];
-
-               total++;
-               if (PageReserved(page))
-                       reserved++;
-               else if (!page_count(page))
-                       free++;
-               else
-                       shared += page_count(page) - 1;
-       }
-
-       printk("%d pages of RAM\n",total);
-       printk("%d free pages\n",free);
-       printk("%d reserved pages\n",reserved);
-       printk("%d pages shared\n",shared);
-
-} /* end show_mem() */
+unsigned long empty_zero_page;
+EXPORT_SYMBOL(empty_zero_page);
 
 /*****************************************************************************/
 /*
@@ -99,7 +70,7 @@ void show_mem(void)
  */
 void __init paging_init(void)
 {
-       unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
+       unsigned long zones_size[MAX_NR_ZONES] = {0, };
 
        /* allocate some pages for kernel housekeeping tasks */
        empty_bad_page_table    = (unsigned long) alloc_bootmem_pages(PAGE_SIZE);
@@ -116,8 +87,6 @@ void __init paging_init(void)
 
                pkmap_page_table = alloc_bootmem_pages(PAGE_SIZE);
 
-               memset(pkmap_page_table, 0, PAGE_SIZE);
-
                pge = swapper_pg_dir + pgd_index_k(PKMAP_BASE);
                pue = pud_offset(pge, PKMAP_BASE);
                pme = pmd_offset(pue, PKMAP_BASE);
@@ -127,8 +96,7 @@ void __init paging_init(void)
 
        /* distribute the allocatable pages across the various zones and pass them to the allocator
         */
-       zones_size[ZONE_DMA]     = max_low_pfn - min_low_pfn;
-       zones_size[ZONE_NORMAL]  = 0;
+       zones_size[ZONE_NORMAL]  = max_low_pfn - min_low_pfn;
 #ifdef CONFIG_HIGHMEM
        zones_size[ZONE_HIGHMEM] = num_physpages - num_mappedpages;
 #endif
@@ -169,7 +137,7 @@ void __init mem_init(void)
                struct page *page = &mem_map[pfn];
 
                ClearPageReserved(page);
-               set_page_count(page, 1);
+               init_page_count(page);
                __free_page(page);
                totalram_pages++;
        }
@@ -199,7 +167,7 @@ void __init mem_init(void)
 /*
  * free the memory that was only required for initialisation
  */
-void __init free_initmem(void)
+void free_initmem(void)
 {
 #if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL)
        unsigned long start, end, addr;
@@ -210,7 +178,7 @@ void __init free_initmem(void)
        /* next to check that the page we free is not a partial page */
        for (addr = start; addr < end; addr += PAGE_SIZE) {
                ClearPageReserved(virt_to_page(addr));
-               set_page_count(virt_to_page(addr), 1);
+               init_page_count(virt_to_page(addr));
                free_page(addr);
                totalram_pages++;
        }
@@ -230,7 +198,7 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
        int pages = 0;
        for (; start < end; start += PAGE_SIZE) {
                ClearPageReserved(virt_to_page(start));
-               set_page_count(virt_to_page(start), 1);
+               init_page_count(virt_to_page(start));
                free_page(start);
                totalram_pages++;
                pages++;