linux-mips
[Top] [All Lists]

[2.5 PATCH] pmd_populate and pmd_page fixes

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: [2.5 PATCH] pmd_populate and pmd_page fixes
From: Vivien Chappelier <vivien.chappelier@enst-bretagne.fr>
Date: Sat, 27 Jul 2002 01:45:37 +0200 (CEST)
Cc: linux-mips@oss.sgi.com
Sender: owner-linux-mips@oss.sgi.com
Hi,

        This patch fixes the pmd_populate and pmd_page functions
introduced in 2.5.5 (the old ones having been renamed as pmd_page_kernel
and pmd_populate_kernel). It applies to 'mips64' but 'mips' should be
corrected as well. Also, I've not checked what should be done in the
HIGHMEM or NUMA case.

Vivien.

--- linux/include/asm-mips64/pgtable.h  Mon Jul 22 20:21:37 2002
+++ linux.new/include/asm-mips64/pgtable.h      Sat Jul 27 00:51:43 2002
@@ -270,7 +270,7 @@
  */
 #define page_pte(page)         page_pte_prot(page, __pgprot(0))
 #define pmd_page_kernel(pmd)   pmd_val(pmd)
-#define pmd_page(pmd)          (mem_map + (pmd_val(pmd) - PAGE_OFFSET))
+#define pmd_page(pmd)          (mem_map + ((pmd_val(pmd) - PAGE_OFFSET) >> 
PAGE_SHIFT))
 
 static inline unsigned long pgd_page(pgd_t pgd)
 {
--- linux/include/asm-mips64/pgalloc.h  Mon Jul 22 20:21:37 2002
+++ linux.new/include/asm-mips64/pgalloc.h      Sat Jul 27 00:53:26 2002
@@ -51,7 +51,7 @@
 }
 
 #define pmd_populate_kernel(mm, pmd, pte)      set_pmd(pmd, __pmd(pte))
-#define pmd_populate(mm, pmd, pte)             set_pmd(pmd, __pmd(pte))
+#define pmd_populate(mm, pmd, page)            set_pmd(pmd, __pmd(((page - 
mem_map) << PAGE_SHIFT) + PAGE_OFFSET))
 #define pgd_populate(mm, pgd, pmd)             set_pgd(pgd, __pgd(pmd))
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)



<Prev in Thread] Current Thread [Next in Thread>
  • [2.5 PATCH] pmd_populate and pmd_page fixes, Vivien Chappelier <=