fix for 4-level page tables introduced in 2.6.12
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Aug 2005 00:29:55 +0000 (00:29 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Aug 2005 00:29:55 +0000 (00:29 +0000)
comedi/drivers.c
include/asm/pgtable.h

index 045ad0ccaeb3570bb7e24715712f0d971a2c7383..8ed325be605124ca4879a45eda94fcbfd869abf7 100644 (file)
@@ -393,9 +393,11 @@ static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
        unsigned long ret = 0UL;
        pmd_t *pmd;
        pte_t *ptep, pte;
-
+       pud_t *pud;
+       
        if(!pgd_none(*pgd)){
-               pmd = pmd_offset(pgd, adr);
+               pud = pud_offset(pgd, adr);
+               pmd = pmd_offset(pud, adr);
                if(!pmd_none(*pmd)){
                        ptep = pte_offset_kernel(pmd, adr);
                        pte = *ptep;
index 20fe5b8d438fb83c8d60797124a0e26f11b09d07..b883905bf1ab6bd516e976691f8db6fb1a48319e 100644 (file)
 #ifndef __COMPAT_ASM_PGTABLE_H_
 #define __COMPAT_ASM_PGTABLE_H_
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
+#define pud_t pgd_t
+#define pud_offset(pgd, start) (pgd)
+#endif
+
 #include_next <asm/pgtable.h>
 
 #ifndef pte_offset_kernel