mirror of
https://github.com/archlinux-jerry/nvidia-340xx
synced 2024-11-16 12:50:40 +08:00
45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
From 53d65b3781b7b2cf25368efd5382ed5bbda19bd9 Mon Sep 17 00:00:00 2001
|
|
From: Alberto Milone <alberto.milone@canonical.com>
|
|
Date: Thu, 21 Sep 2017 15:16:41 +0200
|
|
Subject: [PATCH 1/1] Add support for Linux 4.11
|
|
This only contains the last few bits that didn't make it into
|
|
the 340 driver.
|
|
Credit goes to Michael Marley for spotting the problem.
|
|
---
|
|
uvm/nvidia_uvm_lite.c | 11 +++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
|
|
index 246ed04..119c93a 100644
|
|
--- a/uvm/nvidia_uvm_lite.c
|
|
+++ b/uvm/nvidia_uvm_lite.c
|
|
@@ -818,8 +818,15 @@ done:
|
|
}
|
|
|
|
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
+#else
|
|
+int _fault(struct vm_fault *vmf)
|
|
+#endif
|
|
{
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
|
+ struct vm_area_struct *vma = vmf->vma;
|
|
+#endif
|
|
#if defined(NV_VM_FAULT_HAS_ADDRESS)
|
|
unsigned long vaddr = vmf->address;
|
|
#else
|
|
@@ -866,7 +873,11 @@ static struct vm_operations_struct uvmlite_vma_ops =
|
|
// it's dealing with anonymous mapping (see handle_pte_fault).
|
|
//
|
|
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
+#else
|
|
+int _sigbus_fault(struct vm_fault *vmf)
|
|
+#endif
|
|
{
|
|
vmf->page = NULL;
|
|
return VM_FAULT_SIGBUS;
|
|
--
|
|
2.7.4
|
|
|