diff --git a/srcpkgs/nvidia340/files/kernel-5.0.patch b/srcpkgs/nvidia340/files/kernel-5.0.patch index 01650dbfd79..b6d43e370bc 100644 --- a/srcpkgs/nvidia340/files/kernel-5.0.patch +++ b/srcpkgs/nvidia340/files/kernel-5.0.patch @@ -42,4 +42,48 @@ +#endif status = RM_OK; + +--- kernel/uvm/nvidia_uvm_lite.c 2019-09-10 16:26:28.674315544 +0200 ++++ kernel/uvm/nvidia_uvm_lite.c 2019-09-10 16:28:05.224054277 +0200 +@@ -30,6 +30,16 @@ + #include "nvidia_uvm_lite_counters.h" + #include "ctrl2080mc.h" ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++static inline void do_gettimeofday(struct timeval *tv) { ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ tv->tv_sec = now.tv_sec; ++ tv->tv_usec = now.tv_nsec/1000; ++} ++#endif ++ + // + // nvidia_uvm_lite.c + // This file contains code that is specific to the UVM-Lite mode of operation. +@@ -820,8 +830,10 @@ + #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) ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) ++int _fault(struct vm_fault *vmf) ++#else ++unsigned int _fault(struct vm_fault *vmf) + #endif + { + #if defined(NV_VM_FAULT_HAS_ADDRESS) +@@ -876,8 +888,10 @@ + #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 ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + int _sigbus_fault(struct vm_fault *vmf) ++#else ++unsigned int _sigbus_fault(struct vm_fault *vmf) + #endif + { + vmf->page = NULL; diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template index 0fa1e30c6db..25d6953db03 100644 --- a/srcpkgs/nvidia340/template +++ b/srcpkgs/nvidia340/template @@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)" pkgname=nvidia340 version=340.107 -revision=3 +revision=4 maintainer="Orphaned " license="Proprietary NVIDIA license" homepage="http://www.nvidia.com" @@ -38,7 +38,7 @@ do_extract() { rm -f ${_pkg}.run } -do_configure() { +do_patch() { cd ${_pkg} patch -p0 < ${FILESDIR}/kernel-4.11.patch patch -p0 < ${FILESDIR}/kernel-5.0.patch