patch-2.3.99-pre6 linux/include/asm-arm/pgtable.h

Next file: linux/include/asm-arm/proc-armo/elf.h
Previous file: linux/include/asm-arm/pgalloc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/include/asm-arm/pgtable.h linux/include/asm-arm/pgtable.h
@@ -83,9 +83,9 @@
 #define pmd_clear(pmdp)		set_pmd(pmdp, __pmd(0))
 
 /*
- * Permanent address of a page.
+ * Permanent address of a page. We never have highmem, so this is trivial.
  */
-#define page_address(page)	({ if (!(page)->virtual) BUG(); (page)->virtual; })
+#define page_address(page)	((page)->virtual)
 #define pages_to_mb(x)		((x) >> (20 - PAGE_SHIFT))
 #define pte_page(x)		(mem_map + pte_pagenr(x))
 
@@ -100,13 +100,12 @@
 	return pte;
 }
 
-#define mk_pte(page,pgprot)					\
-({								\
-	pte_t __pte;						\
-	pte_val(__pte) = PHYS_OFFSET + 				\
-			  (((page) - mem_map) << PAGE_SHIFT) +	\
-			   pgprot_val(pgprot);			\
-	__pte;							\
+#define mk_pte(page,pgprot)				\
+({							\
+	pte_t __pte;					\
+	pte_val(__pte) = __pa(page_address(page)) +	\
+			   pgprot_val(pgprot);		\
+	__pte;						\
 })
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)