From ee538eaaa5e49923bcd49911d556ae9fbb96d8c6 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 16 Aug 2005 00:29:55 +0000 Subject: [PATCH] fix for 4-level page tables introduced in 2.6.12 --- comedi/drivers.c | 6 ++++-- include/asm/pgtable.h | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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 -- 2.26.2