summarylogtreecommitdiffstats
path: root/linux-4.12.patch
blob: 796c5ff95f783009ff2b356273dbe630ca24f389 (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
diff -Naur nv.orig/conftest.sh nv/conftest.sh
--- nv.orig/conftest.sh	2017-10-16 16:21:22.549358000 +0200
+++ nv/conftest.sh	2017-10-16 16:32:49.985089045 +0200
@@ -237,7 +237,11 @@
             # Determine if the set_pages_uc() function is present.
             #
             echo "$CONFTEST_PREAMBLE
-            #include <asm/cacheflush.h>
+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+                #include <asm/set_memory.h>
+            #else
+                #include <asm/cacheflush.h>
+            #endif
             void conftest_set_pages_uc(void) {
                 set_pages_uc();
             }" > conftest$$.c
@@ -267,8 +271,10 @@
             #include <linux/version.h>
             #include <linux/utsname.h>
             #include <linux/mm.h>
-            #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-              #include <asm/cacheflush.h>
+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+                #include <asm/set_memory.h>
+            #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+                #include <asm/cacheflush.h>
             #endif
             void conftest_change_page_attr(void) {
                 change_page_attr();
diff -Naur nv.orig/nv-vm.c nv/nv-vm.c
--- nv.orig/nv-vm.c	2013-11-27 23:47:09.000000000 +0100
+++ nv/nv-vm.c	2017-10-16 16:35:11.059602958 +0200
@@ -14,6 +14,10 @@
 #include "nv-linux.h"
 #include "nv-vm.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+    #include <asm/set_memory.h>
+#endif
+
 #if defined(NV_DBG_MEM)
 #define NV_DEFAULT_LIST_PAGE_COUNT 10