void-packages/srcpkgs/nvidia390/files/linux-5.8.x.patch
Jürgen Buchmüller 85bd38d225 nvidia390: fix i686
I known this patch could somehow be applied automagically from
srcpkgs/nvidia390/patches yet a) I'm lazy and b) I'm not too sober.
Please bear with me.
2020-09-15 00:07:39 +02:00

29 lines
1 KiB
Diff

--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-09-10 21:56:45.927763032 +0200
@@ -531,7 +531,11 @@
static inline void *nv_vmalloc(unsigned long size)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
void *ptr = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
+#else
+ void *ptr = __vmalloc(size, GFP_KERNEL);
+#endif
if (ptr)
NV_MEMDBG_ADD(ptr, size);
return ptr;
--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-09-10 22:25:40.666693863 +0200
@@ -29,6 +29,12 @@
typedef int vm_fault_t;
#endif
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+/* kernel 5.8.0-rc1 renamed mmap_sem to mmap_lock */
+#define mmap_sem mmap_lock
+#endif
+
/* get_user_pages
*
* The 8-argument version of get_user_pages was deprecated by commit