powerpc/mm: Add a _PAGE_PTE bit
[linux-2.6-block.git] / arch / powerpc / include / asm / book3s / 64 / hash-64k.h
index 7570677c11c3e38627bafd04ca87d6ef28837601..52110d7af6597dc8f6ecc6175239ea7da3ac95a7 100644 (file)
@@ -130,25 +130,25 @@ extern bool __rpte_sub_valid(real_pte_t rpte, unsigned long index);
 static inline int pmd_huge(pmd_t pmd)
 {
        /*
-        * leaf pte for huge page, bottom two bits != 00
+        * leaf pte for huge page
         */
-       return ((pmd_val(pmd) & 0x3) != 0x0);
+       return !!(pmd_val(pmd) & _PAGE_PTE);
 }
 
 static inline int pud_huge(pud_t pud)
 {
        /*
-        * leaf pte for huge page, bottom two bits != 00
+        * leaf pte for huge page
         */
-       return ((pud_val(pud) & 0x3) != 0x0);
+       return !!(pud_val(pud) & _PAGE_PTE);
 }
 
 static inline int pgd_huge(pgd_t pgd)
 {
        /*
-        * leaf pte for huge page, bottom two bits != 00
+        * leaf pte for huge page
         */
-       return ((pgd_val(pgd) & 0x3) != 0x0);
+       return !!(pgd_val(pgd) & _PAGE_PTE);
 }
 #define pgd_huge pgd_huge
 
@@ -236,10 +236,8 @@ static inline void mark_hpte_slot_valid(unsigned char *hpte_slot_array,
  */
 static inline int pmd_trans_huge(pmd_t pmd)
 {
-       /*
-        * leaf pte for huge page, bottom two bits != 00
-        */
-       return (pmd_val(pmd) & 0x3) && (pmd_val(pmd) & _PAGE_THP_HUGE);
+       return !!((pmd_val(pmd) & (_PAGE_PTE | _PAGE_THP_HUGE)) ==
+                 (_PAGE_PTE | _PAGE_THP_HUGE));
 }
 
 static inline int pmd_trans_splitting(pmd_t pmd)
@@ -251,10 +249,7 @@ static inline int pmd_trans_splitting(pmd_t pmd)
 
 static inline int pmd_large(pmd_t pmd)
 {
-       /*
-        * leaf pte for huge page, bottom two bits != 00
-        */
-       return ((pmd_val(pmd) & 0x3) != 0x0);
+       return !!(pmd_val(pmd) & _PAGE_PTE);
 }
 
 static inline pmd_t pmd_mknotpresent(pmd_t pmd)