patch-2.4.20 linux-2.4.20/include/asm-s390x/page.h

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

diff -urN linux-2.4.19/include/asm-s390x/page.h linux-2.4.20/include/asm-s390x/page.h
@@ -91,13 +91,22 @@
         unsigned long pmd0;
         unsigned long pmd1; 
         } pmd_t;
-typedef struct { unsigned long pgd; } pgd_t;
+typedef unsigned int pgd_t;
 typedef struct { unsigned long pgprot; } pgprot_t;
 
 #define pte_val(x)      ((x).pte)
 #define pmd_val(x)      ((x).pmd0)
 #define pmd_val1(x)     ((x).pmd1)
-#define pgd_val(x)      ((x).pgd)
+
+static inline unsigned long __pgd_val(pgd_t *pgdp)
+{
+	unsigned long addr = (unsigned long) pgdp;
+	unsigned long *pgd_slot = (unsigned long *) (addr & -8);
+
+	return *pgd_slot + ((addr & 4) << 11);
+}
+#define pgd_val(pgd) __pgd_val(&(pgd))
+
 #define pgprot_val(x)   ((x).pgprot)
 
 #define __pte(x)        ((pte_t) { (x) } )

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