vserver 2.0 rc7
[linux-2.6.git] / arch / alpha / mm / init.c
index d02ee45..65320bd 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h> /* max_low_pfn */
 #include <linux/vmalloc.h>
+#include <linux/pagemap.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -42,10 +43,9 @@ pgd_alloc(struct mm_struct *mm)
 {
        pgd_t *ret, *init;
 
-       ret = (pgd_t *)__get_free_page(GFP_KERNEL);
+       ret = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
        init = pgd_offset(&init_mm, 0UL);
        if (ret) {
-               clear_page(ret);
 #ifdef CONFIG_ALPHA_LARGE_VMALLOC
                memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
                        (PTRS_PER_PGD - USER_PTRS_PER_PGD - 1)*sizeof(pgd_t));
@@ -63,9 +63,7 @@ pgd_alloc(struct mm_struct *mm)
 pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-       pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-       if (pte)
-               clear_page(pte);
+       pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
        return pte;
 }
 
@@ -106,7 +104,7 @@ show_mem(void)
 
        printk("\nMem-info:\n");
        show_free_areas();
-       printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+       printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
        i = max_mapnr;
        while (i-- > 0) {
                total++;
@@ -117,7 +115,7 @@ show_mem(void)
                else if (!page_count(mem_map+i))
                        free++;
                else
-                       shared += atomic_read(&mem_map[i].count) - 1;
+                       shared += page_count(mem_map + i) - 1;
        }
        printk("%ld pages of RAM\n",total);
        printk("%ld free pages\n",free);
@@ -152,9 +150,9 @@ switch_to_system_map(void)
 
        /* Set the vptb.  This is often done by the bootloader, but 
           shouldn't be required.  */
-       if (hwrpb->vptb != 0xfffffffe00000000) {
-               wrvptptr(0xfffffffe00000000);
-               hwrpb->vptb = 0xfffffffe00000000;
+       if (hwrpb->vptb != 0xfffffffe00000000UL) {
+               wrvptptr(0xfffffffe00000000UL);
+               hwrpb->vptb = 0xfffffffe00000000UL;
                hwrpb_update_checksum(hwrpb);
        }
 
@@ -301,8 +299,8 @@ srm_paging_stop (void)
        /* Move the vptb back to where the SRM console expects it.  */
        swapper_pg_dir[1] = swapper_pg_dir[1023];
        tbia();
-       wrvptptr(0x200000000);
-       hwrpb->vptb = 0x200000000;
+       wrvptptr(0x200000000UL);
+       hwrpb->vptb = 0x200000000UL;
        hwrpb_update_checksum(hwrpb);
 
        /* Reload the page tables that the console had in use.  */