Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / asm-generic / 4level-fixup.h
index 0267574..68c6fea 100644 (file)
@@ -2,6 +2,7 @@
 #define _4LEVEL_FIXUP_H
 
 #define __ARCH_HAS_4LEVEL_HACK
+#define __PAGETABLE_PUD_FOLDED
 
 #define PUD_SIZE                       PGDIR_SIZE
 #define PUD_MASK                       PGDIR_MASK
@@ -9,14 +10,9 @@
 
 #define pud_t                          pgd_t
 
-#define pmd_alloc(mm, pud, address)                    \
-({     pmd_t *ret;                                     \
-       if (pgd_none(*pud))                             \
-               ret = __pmd_alloc(mm, pud, address);    \
-       else                                            \
-               ret = pmd_offset(pud, address);         \
-       ret;                                            \
-})
+#define pmd_alloc(mm, pud, address) \
+       ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \
+               NULL: pmd_offset(pud, address))
 
 #define pud_alloc(mm, pgd, address)    (pgd)
 #define pud_offset(pgd, start)         (pgd)
@@ -31,4 +27,7 @@
 #define pud_free(x)                    do { } while (0)
 #define __pud_free_tlb(tlb, x)         do { } while (0)
 
+#undef  pud_addr_end
+#define pud_addr_end(addr, end)                (end)
+
 #endif