summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2005-01-06 17:09:22 +0000
committerJon Smirl <jonsmirl@yahoo.com>2005-01-06 17:09:22 +0000
commitc6c7496ca090dd56599de5bb1398f69762569d5e (patch)
tree1acfdde64abdb8f2468087b45374e4731d2ac7e1
parent50a6ffa8789ca12029da1db86ad8c90ce62cd241 (diff)
Adjust drm-memory for 4 level page tables in 2.6.10 ifdef'd to use 3 levels
in kernels older than 2.6.10
-rw-r--r--linux-core/drm_memory.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h
index e3ac883d..d6856e14 100644
--- a/linux-core/drm_memory.h
+++ b/linux-core/drm_memory.h
@@ -136,9 +136,14 @@ static inline void *agp_remap(unsigned long offset, unsigned long size,
static inline unsigned long drm_follow_page(void *vaddr)
{
- pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
+ pgd_t *pgd = pgd_offset_k((unsigned long) vaddr);
+#if LINUX_VERSION_CODE < 0x02060a /* KERNEL_VERSION(2,6,10) */
pmd_t *pmd = pmd_offset(pgd, (unsigned long)vaddr);
- pte_t *ptep = pte_offset_kernel(pmd, (unsigned long)vaddr);
+#else
+ pud_t *pud = pud_offset(pgd, (unsigned long) vaddr);
+ pmd_t *pmd = pmd_offset(pud, (unsigned long) vaddr);
+#endif
+ pte_t *ptep = pte_offset_kernel(pmd, (unsigned long) vaddr);
return pte_pfn(*ptep) << PAGE_SHIFT;
}