vserver 1.9.5.x5
[linux-2.6.git] / include / asm-s390 / pgtable.h
index c74a47e..85f043c 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef _ASM_S390_PGTABLE_H
 #define _ASM_S390_PGTABLE_H
 
+#include <asm-generic/4level-fixup.h>
+
 /*
  * The Linux memory management assumes a three-level page table setup. For
  * s390 31 bit we "fold" the mid level into the top-level page table, so
@@ -416,6 +418,14 @@ extern inline int pte_young(pte_t pte)
        return 0;
 }
 
+extern inline int pte_read(pte_t pte)
+{
+       /* All pages are readable since we don't use the fetch
+        * protection bit in the storage key.
+        */
+       return 1;
+}
+
 /*
  * pgd/pmd/pte modification functions
  */
@@ -679,7 +689,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 #define pgd_page_kernel(pgd) (pgd_val(pgd) & PAGE_MASK)
 
 /* to find an entry in a page-table-directory */
-#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
+#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
 #define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
 
 /* to find an entry in a kernel page-table-directory */