summarylogtreecommitdiffstats
path: root/4.2-ubuntu_buildfix_kernel_4.2-modified.patch
blob: 60a82b7c1d1a01ab7ceb66130b9ca0dbfd5a4838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- 15.11/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-11-08 17:32:54.748514621 +0100
+++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-11-08 17:46:13.157284759 +0100
@@ -190,9 +190,17 @@
 #include <linux/string.h>
 #include <linux/gfp.h>
 #include <linux/swap.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include "asm/i387.h"
+#else
+#include <asm/fpu/api.h>
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include <asm/fpu-internal.h>
+#else
+#include <asm/fpu/internal.h>
+#endif
 #endif
 
 #include "firegl_public.h"
@@ -1662,6 +1670,9 @@
 
 #if defined(__i386__) 
 #ifndef __HAVE_ARCH_CMPXCHG
+#ifndef __xg
+#define __xg(x) ((volatile long *)(x))
+#endif
 static inline 
 unsigned long __fgl_cmpxchg(volatile void *ptr, unsigned long old,            
                         unsigned long new, int size)                      
@@ -1698,7 +1709,11 @@
          unsigned long new, int size)
 {
 #ifndef __HAVE_ARCH_CMPXCHG
+#if defined(__i386__)
     return __fgl_cmpxchg(ptr,old,new,size);
+#elif defined(__x86_64__)
+    return cmpxchg((unsigned long*)ptr,old,new);
+#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
@@ -6117,8 +6132,12 @@
 void ATI_API_CALL KCL_fpu_begin(void)
 {
 #ifdef CONFIG_X86_64
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
     kernel_fpu_begin();
 #else
+    __kernel_fpu_begin();
+#endif
+#else
 #ifdef TS_USEDFPU
     struct thread_info *cur_thread = current_thread_info();
     struct task_struct *cur_task = get_current();
@@ -6154,7 +6173,11 @@
  */
 void ATI_API_CALL KCL_fpu_end(void)
 {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
     kernel_fpu_end();
+#else
+    __kernel_fpu_end();
+#endif
 }
 
 #endif /* __KERNEL__ */