From: Frank Mori Hess Date: Tue, 16 Aug 2005 00:29:55 +0000 (+0000) Subject: fix for 4-level page tables introduced in 2.6.12 X-Git-Tag: branch-0_7-end~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee538eaaa5e49923bcd49911d556ae9fbb96d8c6;p=comedi.git fix for 4-level page tables introduced in 2.6.12 --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 045ad0cc..8ed325be 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -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; diff --git a/include/asm/pgtable.h b/include/asm/pgtable.h index 20fe5b8d..b883905b 100644 --- a/include/asm/pgtable.h +++ b/include/asm/pgtable.h @@ -19,6 +19,13 @@ #ifndef __COMPAT_ASM_PGTABLE_H_ #define __COMPAT_ASM_PGTABLE_H_ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) +#define pud_t pgd_t +#define pud_offset(pgd, start) (pgd) +#endif + #include_next #ifndef pte_offset_kernel