8fc9c3d069
Closes #2959
73 lines
2.3 KiB
Diff
73 lines
2.3 KiB
Diff
Fix for kernel >= 4.2.0
|
|
|
|
--- fglrx-15.201.1151.orig/common/lib/modules/fglrx/build_mod/firegl_public.c
|
|
+++ fglrx-15.201.1151/common/lib/modules/fglrx/build_mod/firegl_public.c
|
|
@@ -191,8 +191,14 @@
|
|
#include <linux/string.h>
|
|
#include <linux/gfp.h>
|
|
#include <linux/swap.h>
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
|
|
+#include "asm/fpu/api.h"
|
|
+#else
|
|
#include "asm/i387.h"
|
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
|
|
+#endif
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
|
|
+#include <asm/fpu/internal.h>
|
|
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
|
|
#include <asm/fpu-internal.h>
|
|
#endif
|
|
|
|
@@ -1700,6 +1706,7 @@ void ATI_API_CALL KCL_SetCurrentProcessS
|
|
current->state = KCL_MAP_ProcessState[state];
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
|
|
#if defined(__i386__)
|
|
#ifndef __HAVE_ARCH_CMPXCHG
|
|
static inline
|
|
@@ -1733,12 +1740,15 @@ unsigned long __fgl_cmpxchg(volatile voi
|
|
#elif defined(__alpha__)
|
|
todo !!!
|
|
#endif
|
|
+#endif
|
|
|
|
unsigned long ATI_API_CALL kcl__cmpxchg(volatile void *ptr, unsigned long old,
|
|
unsigned long new, int size)
|
|
{
|
|
#ifndef __HAVE_ARCH_CMPXCHG
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
|
|
return __fgl_cmpxchg(ptr,old,new,size);
|
|
+#endif
|
|
#else
|
|
/* On kernel version 2.6.34 passing a variable or unsupported size
|
|
* argument to the __cmpxchg macro causes the default-clause of a
|
|
@@ -6456,7 +6466,7 @@ void ATI_API_CALL KCL_create_uuid(void *
|
|
static int KCL_fpu_save_init(struct task_struct *tsk)
|
|
{
|
|
struct fpu *fpu = &tsk->thread.fpu;
|
|
-
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
|
|
if(static_cpu_has(X86_FEATURE_XSAVE)) {
|
|
fpu_xsave(fpu);
|
|
if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
|
|
@@ -6473,6 +6483,7 @@ static int KCL_fpu_save_init(struct task
|
|
asm volatile("fnclex");
|
|
return 0;
|
|
}
|
|
+#endif
|
|
return 1;
|
|
}
|
|
#endif
|
|
@@ -6505,7 +6516,9 @@ void ATI_API_CALL KCL_fpu_begin(void)
|
|
*/
|
|
struct task_struct *cur_task = current;
|
|
preempt_disable();
|
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
|
|
+ if (cur_task->thread.fpu.fpregs_active)
|
|
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
|
|
/* The thread structure is changed with the commit below for kernel 3.3:
|
|
* https://github.com/torvalds/linux/commit/7e16838d94b566a17b65231073d179bc04d590c8
|
|
*/
|
|
|