summaryrefslogtreecommitdiffstats
path: root/kernel/amd-3.5.0-missing_do_mmap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/amd-3.5.0-missing_do_mmap.patch')
-rw-r--r--kernel/amd-3.5.0-missing_do_mmap.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/kernel/amd-3.5.0-missing_do_mmap.patch b/kernel/amd-3.5.0-missing_do_mmap.patch
new file mode 100644
index 000000000..bb61eabe3
--- /dev/null
+++ b/kernel/amd-3.5.0-missing_do_mmap.patch
@@ -0,0 +1,44 @@
+--- lib/modules/fglrx/build_mod/firegl_public.c
++++ lib/modules/fglrx/build_mod/firegl_public.c
+@@ -2148,9 +2148,13 @@ unsigned long ATI_API_CALL KCL_MEM_Alloc
+ flags = MAP_SHARED;
+ prot = PROT_READ|PROT_WRITE;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
++ vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff);
++#else
+ down_write(&current->mm->mmap_sem);
+ vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff);
+ up_write(&current->mm->mmap_sem);
++#endif
+ if (IS_ERR(vaddr))
+ return 0;
+ else
+@@ -2161,6 +2165,16 @@ int ATI_API_CALL KCL_MEM_ReleaseLinearAd
+ {
+ int retcode = 0;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
++#ifdef FGL_LINUX_RHEL_MUNMAP_API
++ retcode = vm_munmap(addr,
++ len,
++ 1);
++#else
++ retcode = vm_munmap(addr,
++ len);
++#endif
++#else
+ down_write(&current->mm->mmap_sem);
+ #ifdef FGL_LINUX_RHEL_MUNMAP_API
+ retcode = do_munmap(current->mm,
+@@ -2171,8 +2185,9 @@ int ATI_API_CALL KCL_MEM_ReleaseLinearAd
+ retcode = do_munmap(current->mm,
+ addr,
+ len);
+-#endif
+ up_write(&current->mm->mmap_sem);
++#endif
++#endif
+ return retcode;
+ }
+