void-packages/srcpkgs/nvidia340/files/kernel-4.11.patch

39 lines
1.1 KiB
Diff

--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200
@@ -818,7 +818,11 @@
}
#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 defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
@@ -828,7 +832,11 @@
struct page *page = NULL;
int retval;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
retval = _fault_common(vma, vaddr, &page, vmf->flags);
+#else
+ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
+#endif
vmf->page = page;
@@ -866,7 +874,11 @@
// 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;