nvidia340: fix build issues on x86_64

re-introduce compatibility patch for nvidia-uvm_lite needed due to changes in
vm_operations_struct in linux-4.11 and above.

Closes: #7844 [via git-merge-pr]
This commit is contained in:
Helmut Pozimski 2017-09-27 14:11:35 +02:00 committed by lemmi
parent faeb01af77
commit 59d62b3092
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,38 @@
--- 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;

View File

@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
pkgname=nvidia340
version=340.104
revision=1
revision=2
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="Proprietary NVIDIA license"
homepage="http://www.nvidia.com"
@ -38,6 +38,11 @@ do_extract() {
rm -f ${_pkg}.run
}
do_configure() {
cd ${_pkg}
patch -p0 < ${FILESDIR}/kernel-4.11.patch
}
do_install() {
cd ${_pkg}