From 18f8cfefa53425613cd269aa576b6f80a779fce0 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 20 Sep 2019 11:33:49 +0800 Subject: [PATCH] 340.107-91: patch for kernel 5.3 --- .SRCINFO | 4 +++- PKGBUILD | 8 +++++--- kernel-5.3.patch | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 kernel-5.3.patch diff --git a/.SRCINFO b/.SRCINFO index bcf66aa..c7ef71f 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = nvidia-340xx pkgdesc = NVIDIA drivers for linux, 340xx legacy branch pkgver = 340.107 - pkgrel = 90 + pkgrel = 91 url = http://www.nvidia.com/ arch = x86_64 license = custom @@ -14,10 +14,12 @@ pkgbase = nvidia-340xx source = kernel-4.11.patch source = kernel-5.0.patch source = kernel-5.1.patch + source = kernel-5.3.patch sha512sums = 0de6f182d67bd322df7ae04e74c0cde6973c55bfea47a8f2503a29f8a899cd1b801ae4b52d066628df4a4f9c84e5e7547465bdc37d1b87df47af43fdab23466f sha512sums = c25d90499e1deb26129a67dd7e953be8c1e31c5770e2b8b64d03af54cf1afec1a52636e74900f8ac468692207ab8a3765a12edd581142c4d2cfd2d6e66ac7ac2 sha512sums = ad60f9d09b6e8d5038375f9ddaab93341958f9400f40f5175857e44c7f7002d481121dc5d677703551c3cdf24069939ac6a1861920a455acf40e637f24234a56 sha512sums = 4bde7d15d68d21a8254e82cb41b07e55b3fd04054251919159dc440bf3253de76d7066e69b21c33d00d5ba61f88589b5444c2b5765c54cd1c0bcd7300971d499 + sha512sums = 6a25ea6845c4e5732abcfa6b29fbb13248f15b86c5350b0072e61a64064d506d0f605a26f01adec3f98196e88e819711719c52e71f13fafc6d56ec237bf82d96 pkgname = nvidia-340xx pkgdesc = NVIDIA drivers for linux, 340xx legacy branch diff --git a/PKGBUILD b/PKGBUILD index 5f37779..0736ae2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,7 +6,7 @@ pkgbase=nvidia-340xx pkgname=(nvidia-340xx nvidia-340xx-dkms) pkgver=340.107 _extramodules=extramodules-ARCH -pkgrel=90 +pkgrel=91 pkgdesc="NVIDIA drivers for linux, 340xx legacy branch" arch=('x86_64') url="http://www.nvidia.com/" @@ -15,11 +15,12 @@ conflicts=('nvidia') license=('custom') options=('!strip') source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run" - 'kernel-4.11.patch' 'kernel-5.0.patch' 'kernel-5.1.patch') + 'kernel-4.11.patch' 'kernel-5.0.patch' 'kernel-5.1.patch' 'kernel-5.3.patch') sha512sums=('0de6f182d67bd322df7ae04e74c0cde6973c55bfea47a8f2503a29f8a899cd1b801ae4b52d066628df4a4f9c84e5e7547465bdc37d1b87df47af43fdab23466f' 'c25d90499e1deb26129a67dd7e953be8c1e31c5770e2b8b64d03af54cf1afec1a52636e74900f8ac468692207ab8a3765a12edd581142c4d2cfd2d6e66ac7ac2' 'ad60f9d09b6e8d5038375f9ddaab93341958f9400f40f5175857e44c7f7002d481121dc5d677703551c3cdf24069939ac6a1861920a455acf40e637f24234a56' - '4bde7d15d68d21a8254e82cb41b07e55b3fd04054251919159dc440bf3253de76d7066e69b21c33d00d5ba61f88589b5444c2b5765c54cd1c0bcd7300971d499') + '4bde7d15d68d21a8254e82cb41b07e55b3fd04054251919159dc440bf3253de76d7066e69b21c33d00d5ba61f88589b5444c2b5765c54cd1c0bcd7300971d499' + '6a25ea6845c4e5732abcfa6b29fbb13248f15b86c5350b0072e61a64064d506d0f605a26f01adec3f98196e88e819711719c52e71f13fafc6d56ec237bf82d96') _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32" @@ -31,6 +32,7 @@ prepare() { patch -Np0 < "${srcdir}/kernel-4.11.patch" patch -Np0 < "${srcdir}/kernel-5.0.patch" patch -Np0 < "${srcdir}/kernel-5.1.patch" + patch -Np0 < "${srcdir}/kernel-5.3.patch" cp -a kernel kernel-dkms } diff --git a/kernel-5.3.patch b/kernel-5.3.patch new file mode 100644 index 0000000..c51a41d --- /dev/null +++ b/kernel-5.3.patch @@ -0,0 +1,49 @@ +diff --git kernel/nv-linux.h kernel/nv-linux.h +index 4043bf1..62f0874 100644 +--- kernel/nv-linux.h ++++ kernel/nv-linux.h +@@ -877,12 +877,21 @@ extern void *nv_stack_t_cache; + __ret; \ + }) + #elif (NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT == 3) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0) + #define NV_SMP_CALL_FUNCTION(func, info, wait) \ + ({ \ + int __ret = smp_call_function(func, info, wait); \ + __ret; \ + }) + #else ++#define NV_SMP_CALL_FUNCTION(func, info, wait) \ ++ ({ \ ++ int __ret = 0; \ ++ smp_call_function(func, info, wait); \ ++ __ret; \ ++ }) ++#endif ++#else + #error "NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT value unrecognized!" + #endif + #elif defined(CONFIG_SMP) +@@ -897,12 +906,21 @@ extern void *nv_stack_t_cache; + __ret; \ + }) + #elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0) + #define NV_ON_EACH_CPU(func, info, wait) \ + ({ \ + int __ret = on_each_cpu(func, info, wait); \ + __ret; \ + }) + #else ++#define NV_ON_EACH_CPU(func, info, wait) \ ++ ({ \ ++ int __ret = 0; \ ++ on_each_cpu(func, info, wait); \ ++ __ret; \ ++ }) ++#endif ++#else + #error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!" + #endif + #elif defined(CONFIG_SMP) +