patch-2.4.4 linux/include/asm-s390x/pgtable.h

Next file: linux/include/asm-s390x/ptrace.h
Previous file: linux/include/asm-s390x/pgalloc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/include/asm-s390x/pgtable.h linux/include/asm-s390x/pgtable.h
@@ -228,21 +228,41 @@
 /*
  * pgd/pmd/pte query functions
  */
-extern inline int pgd_present(pgd_t pgd) { return pgd_val(pgd) != 0; }
-extern inline int pgd_none(pgd_t pgd)    { return pgd_val(pgd) & _PGD_ENTRY_INV; }
+extern inline int pgd_present(pgd_t pgd)
+{
+	return (pgd_val(pgd) & ~PAGE_MASK) == _PGD_ENTRY;
+}
+
+extern inline int pgd_none(pgd_t pgd)
+{
+	return pgd_val(pgd) & _PGD_ENTRY_INV;
+}
+
 extern inline int pgd_bad(pgd_t pgd)
 {
 	return (pgd_val(pgd) & (~PAGE_MASK & ~_PGD_ENTRY_INV)) != _PGD_ENTRY;
 }
 
-extern inline int pmd_present(pmd_t pmd) { return pmd_val(pmd) != 0; }
-extern inline int pmd_none(pmd_t pmd)    { return pmd_val(pmd) & _PMD_ENTRY_INV; }
+extern inline int pmd_present(pmd_t pmd)
+{
+	return (pmd_val(pmd) & ~PAGE_MASK) == _PMD_ENTRY;
+}
+
+extern inline int pmd_none(pmd_t pmd)
+{
+	return pmd_val(pmd) & _PMD_ENTRY_INV;
+}
+
 extern inline int pmd_bad(pmd_t pmd)
 {
 	return (pmd_val(pmd) & (~PAGE_MASK & ~_PMD_ENTRY_INV)) != _PMD_ENTRY;
 }
 
-extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
+extern inline int pte_present(pte_t pte)
+{
+	return pte_val(pte) & _PAGE_PRESENT;
+}
+
 extern inline int pte_none(pte_t pte)
 {
 	return ((pte_val(pte) & 
@@ -411,17 +431,6 @@
 #define mk_pte(page,pgprot) mk_pte_phys(__pa(((page)-mem_map)<<PAGE_SHIFT),pgprot)
 
 #define pte_page(x) (mem_map+(unsigned long)((pte_val(x) >> PAGE_SHIFT)))
-
-extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
-{
-	pmd_val(*pmdp) = _PMD_ENTRY | __pa(ptep);
-	pmd_val1(*pmdp) = _PMD_ENTRY | __pa(ptep+256);
-}
-
-extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
-{
-	pgd_val(*pgdp) = _PGD_ENTRY | __pa(pmdp);
-}
 
 #define pmd_page(pmd) \
         ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))

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