blob: 7d4501eca8ee662e2d5f5f828f06c9811042a8f4 (
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
|
From 38a66ed47f5340abd370edcd1f7cf816b8ad478e Mon Sep 17 00:00:00 2001
From: BlackEagle <ike.devolder@gmail.com>
Date: Thu, 6 Aug 2020 12:11:38 +0200
Subject: [PATCH 1/2] kernel-4.16.patch
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
---
kernel/common/inc/nv-linux.h | 4 ++++
kernel/conftest.sh | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
index ac5bb95..ce6f891 100644
--- a/kernel/common/inc/nv-linux.h
+++ b/kernel/common/inc/nv-linux.h
@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid)
#if defined(NV_VM_INSERT_PAGE_PRESENT)
#include <linux/pagemap.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
#include <linux/dma-mapping.h>
+#else
+#include <linux/dma-direct.h>
+#endif
#endif
#if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 7da7505..0778ba1 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -2045,7 +2045,12 @@ compile_test() {
# Determine if the phys_to_dma function is present.
#
CODE="
+ #include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
#include <linux/dma-mapping.h>
+#else
+ #include <linux/dma-direct.h>
+#endif
void conftest_phys_to_dma(void) {
phys_to_dma();
}"
--
2.28.0
|