[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] fglrx8.8.25 and 4 level pagetables
- From: Alexandru Fomin <yo3fxy at spymac dot com>
- Date: Sat, 12 Feb 2005 14:04:19 +0200
Hi Flavio,
please replace patch
limbo/patches-8.8.25/pmd_offset-2.6.11rc1-warn_cleanup.diff
in your next release with the attached patch that I stripped
down from a larger patch in the next rage3d thread:
<http://www.rage3d.com/board/showthread.php?t=33798874&page=2>
Also would be nice if x86_64 owners would test it with an 2.6.11-rcX
kernel and report if it worked for them or not, as they should be the
ones affected (86_64 uses now 4-level page tables, whereas x86 has
only 3).
Tnx.
--- firegl_public.c.orig 2005-02-12 13:30:15.220853088 +0200
+++ firegl_public.c 2005-02-12 13:35:48.226228576 +0200
@@ -1669,13 +1669,22 @@ unsigned long ATI_API_CALL __ke_get_vm_p
{
unsigned long pte_linear;
pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_t* pud_p;
+#endif
pmd_t* pmd_p;
pte_t* pte_p;
pte_t pte;
pte_linear = VMALLOC_VMADDR(virtual_addr); // convert to pte linear address (x86 => nop)
pgd_p = pgd_offset(mm, pte_linear);
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_p = pud_offset(pgd_p, pte_linear);
+ pmd_p = pmd_offset(pud_p, pte_linear);
+#else
pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
+
#ifndef FGL_ATOMIC_PTE
#if LINUX_VERSION_CODE > 0x020500
pte_p = pte_offset_kernel(pmd_p, pte_linear);
@@ -2105,6 +2114,9 @@ static __inline__ vm_nopage_ret_t do_vm_
unsigned long address)
{
pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_t* pud_p;
+#endif
pmd_t* pmd_p;
pte_t* pte_p;
pte_t pte;
@@ -2205,7 +2217,12 @@ static __inline__ vm_nopage_ret_t do_vm_
/* alternatively we could generate a NOPAGE_OOM "out of memory" */
}
/* locate medium level page table (x86 => nop) */
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_p = pud_offset(pgd_p, pte_linear);
+ pmd_p = pmd_offset(pud_p, pte_linear);
+#else
pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
if (!pmd_present(*pmd_p))
{
__KE_ERROR("FATAL ERROR: User queue buffer not present! (pmd)\n");
@@ -2569,13 +2586,21 @@ char* ATI_API_CALL __ke_vm_phys_addr_str
{
unsigned long pte_linear;
pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_t* pud_p;
+#endif
pmd_t* pmd_p;
pte_t* pte_p;
pte_t pte;
pte_linear = VMALLOC_VMADDR(virtual_addr); // convert to pte linear address (x86 => nop)
pgd_p = pgd_offset(vma->vm_mm, pte_linear);
+#if LINUX_VERSION_CODE > 0x02060a /* KERNEL_VERSION(2,6,11) */
+ pud_p = pud_offset(pgd_p, pte_linear);
+ pmd_p = pmd_offset(pud_p, pte_linear);
+#else
pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
#ifndef FGL_ATOMIC_PTE
#if LINUX_VERSION_CODE > 0x020500
pte_p = pte_offset_kernel(pmd_p, pte_linear);