summaryrefslogtreecommitdiffstats
path: root/driver/compat.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-08-25 01:23:11 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-08-25 01:23:11 +0200
commit8cb6d1301a4d6759dd605e835e3f553149cfb31d (patch)
treebf97e1a9935c738ce6e25089bf31dc0efafde4e2 /driver/compat.h
parent162d6b9bd9452ba786ffdfc4ff00f1c939d34536 (diff)
downloadpcitool-8cb6d1301a4d6759dd605e835e3f553149cfb31d.tar.gz
pcitool-8cb6d1301a4d6759dd605e835e3f553149cfb31d.tar.bz2
pcitool-8cb6d1301a4d6759dd605e835e3f553149cfb31d.tar.xz
pcitool-8cb6d1301a4d6759dd605e835e3f553149cfb31d.zip
Due to active back-porting in Linux LTS branches, there are some comptaibility issues in the driver. This adds support for kernel 4.4.159
Diffstat (limited to 'driver/compat.h')
-rw-r--r--driver/compat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/driver/compat.h b/driver/compat.h
index ba9d15a..e6ff69e 100644
--- a/driver/compat.h
+++ b/driver/compat.h
@@ -41,6 +41,9 @@
# define get_user_pages_compat(vma, nr, pages) get_user_pages(vma, nr, FOLL_WRITE, pages, NULL)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
# define get_user_pages_compat(vma, nr, pages) get_user_pages(vma, nr, 1, 0, pages, NULL)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,159))
+ // Looks like some updates from 4.9 were backported to 4.4 LTS kernel. On Ubuntu, at least 4.4.159 needs this variant
+# define get_user_pages_compat(vma, nr, pages) get_user_pages(current, current->mm, vma, nr, FOLL_WRITE, pages, NULL)
#else
# define get_user_pages_compat(vma, nr, pages) get_user_pages(current, current->mm, vma, nr, 1, 0, pages, NULL)
#endif