[arch-commits] Commit in ndiswrapper/repos/community-x86_64 (9 files)

Christian Hesse eworm at archlinux.org
Fri Apr 3 20:25:00 UTC 2020


    Date: Friday, April 3, 2020 @ 20:24:58
  Author: eworm
Revision: 611218

archrelease: copy trunk to community-x86_64

Added:
  ndiswrapper/repos/community-x86_64/PKGBUILD
    (from rev 611217, ndiswrapper/trunk/PKGBUILD)
  ndiswrapper/repos/community-x86_64/dkms.conf
    (from rev 611217, ndiswrapper/trunk/dkms.conf)
  ndiswrapper/repos/community-x86_64/kernel-5.3.patch
    (from rev 611217, ndiswrapper/trunk/kernel-5.3.patch)
  ndiswrapper/repos/community-x86_64/kernel-5.4.patch
    (from rev 611217, ndiswrapper/trunk/kernel-5.4.patch)
  ndiswrapper/repos/community-x86_64/kernel-5.5.patch
    (from rev 611217, ndiswrapper/trunk/kernel-5.5.patch)
  ndiswrapper/repos/community-x86_64/kernel-5.6.patch
    (from rev 611217, ndiswrapper/trunk/kernel-5.6.patch)
Deleted:
  ndiswrapper/repos/community-x86_64/PKGBUILD
  ndiswrapper/repos/community-x86_64/dkms.conf
  ndiswrapper/repos/community-x86_64/linux-5.3.patch

------------------+
 PKGBUILD         |   97 ++++++++++++++++++++++++++++-------------------------
 dkms.conf        |   48 +++++++++++++-------------
 kernel-5.3.patch |   69 +++++++++++++++++++++++++++++++++++++
 kernel-5.4.patch |   22 ++++++++++++
 kernel-5.5.patch |   72 +++++++++++++++++++++++++++++++++++++++
 kernel-5.6.patch |   85 ++++++++++++++++++++++++++++++++++++++++++++++
 linux-5.3.patch  |   69 -------------------------------------
 7 files changed, 324 insertions(+), 138 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-03 20:24:47 UTC (rev 611217)
+++ PKGBUILD	2020-04-03 20:24:58 UTC (rev 611218)
@@ -1,45 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: maz-1 <loveayawaka at gmail.com>
-
-pkgbase=ndiswrapper
-pkgname=(ndiswrapper-dkms ndiswrapper)
-pkgver=1.62
-_extramodules=extramodules-ARCH
-pkgrel=1
-pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors"
-arch=('x86_64')
-url="https://sourceforge.net/projects/ndiswrapper/"
-license=('GPL')
-source=("https://sourceforge.net/projects/ndiswrapper/files/stable/ndiswrapper-$pkgver.tar.gz"
-        'dkms.conf' 'linux-5.3.patch')
-sha512sums=('a6e111bc699572642e44d6d31cc2f06374648a01b8dd7dd4e74d6ad5e187e39f99faee38f792c83a94d4618ae4d8866914fb3f60b1d80e838a753285ea7cf783'
-            '9fce255fc02ddf6e939dc61a5e29c0ea5fa1a31ecc3c390081bc53aa1cd48eddf5db621f0a1cb909634529d4ccc2995eea8827be8eb5807b34dc17e15045ecf4'
-            'c404f35280534b172235c5c578657d7a30ac2253c7c2abedd65a183d09390e95e7c3030cb409accb4d198ff0411482f8029f8664418c99d5672f92e9c733801d')
-
-prepare() {
-  cd ndiswrapper-$pkgver
-  patch --no-backup-if-mismatch -p2 -i "$srcdir"/linux-5.3.patch
-}
-
-build() {
-  cd ndiswrapper-$pkgver
-  make -C utils
-}
-
-package_ndiswrapper-dkms() {
-  depends=('dkms')
-  provides=('NDISWRAPPER-MODULE')
-  conflicts=('NDISWRAPPER-MODULE')
-
-  cd ndiswrapper-$pkgver
-  mkdir -p "$pkgdir"/usr/src
-  cp -RL ./driver "$pkgdir"/usr/src/ndiswrapper-$pkgver
-  cp "$srcdir"/dkms.conf "$pkgdir"/usr/src/ndiswrapper-$pkgver
-}
-
-package_ndiswrapper() {
-  depends=('NDISWRAPPER-MODULE')
-
-  cd ndiswrapper-$pkgver
-  make -C utils sbindir=/usr/bin usrsbindir=/usr/bin DESTDIR="$pkgdir" install
-}

Copied: ndiswrapper/repos/community-x86_64/PKGBUILD (from rev 611217, ndiswrapper/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,52 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: maz-1 <loveayawaka at gmail.com>
+
+pkgbase=ndiswrapper
+pkgname=(ndiswrapper-dkms ndiswrapper)
+pkgver=1.62
+_extramodules=extramodules-ARCH
+pkgrel=2
+pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors"
+arch=('x86_64')
+url="https://sourceforge.net/projects/ndiswrapper/"
+license=('GPL')
+source=("https://sourceforge.net/projects/ndiswrapper/files/stable/ndiswrapper-$pkgver.tar.gz"
+        'kernel-5.3.patch' 'kernel-5.4.patch' 'kernel-5.5.patch' 'kernel-5.6.patch'
+        'dkms.conf')
+sha512sums=('a6e111bc699572642e44d6d31cc2f06374648a01b8dd7dd4e74d6ad5e187e39f99faee38f792c83a94d4618ae4d8866914fb3f60b1d80e838a753285ea7cf783'
+            'c404f35280534b172235c5c578657d7a30ac2253c7c2abedd65a183d09390e95e7c3030cb409accb4d198ff0411482f8029f8664418c99d5672f92e9c733801d'
+            '36450042db79ed4545030276bff9db1bc9895259f38c1c0bf4dc238ad76ec61c2e08d437997dafd327f2a8fd1694d61e418941555e92144e3ec86c8066561429'
+            'ed543cbfb236de0a20e1f164c22c83cd19aec416b5f50a58cee731857231c667d166c36814047174bddda36261af71e92ecdb2944e5b818a603085af279fbd89'
+            'f37efd16a32c4a36607d43ccda0979a914521157e2095db4c331315638f24d440d8628ea7e98c96f92155e1df133478f0ce9eb76152e963eca4a3fecafbca155'
+            '9fce255fc02ddf6e939dc61a5e29c0ea5fa1a31ecc3c390081bc53aa1cd48eddf5db621f0a1cb909634529d4ccc2995eea8827be8eb5807b34dc17e15045ecf4')
+
+prepare() {
+  cd ndiswrapper-$pkgver
+  patch --no-backup-if-mismatch -p2 -i "$srcdir"/kernel-5.3.patch
+  patch --no-backup-if-mismatch -p1 -i "$srcdir"/kernel-5.4.patch
+  patch --no-backup-if-mismatch -p1 -i "$srcdir"/kernel-5.5.patch
+  patch --no-backup-if-mismatch -p1 -i "$srcdir"/kernel-5.6.patch
+}
+
+build() {
+  cd ndiswrapper-$pkgver
+  make -C utils
+}
+
+package_ndiswrapper-dkms() {
+  depends=('dkms')
+  provides=('NDISWRAPPER-MODULE')
+  conflicts=('NDISWRAPPER-MODULE')
+
+  cd ndiswrapper-$pkgver
+  mkdir -p "$pkgdir"/usr/src
+  cp -RL ./driver "$pkgdir"/usr/src/ndiswrapper-$pkgver
+  cp "$srcdir"/dkms.conf "$pkgdir"/usr/src/ndiswrapper-$pkgver
+}
+
+package_ndiswrapper() {
+  depends=('NDISWRAPPER-MODULE')
+
+  cd ndiswrapper-$pkgver
+  make -C utils sbindir=/usr/bin usrsbindir=/usr/bin DESTDIR="$pkgdir" install
+}

Deleted: dkms.conf
===================================================================
--- dkms.conf	2020-04-03 20:24:47 UTC (rev 611217)
+++ dkms.conf	2020-04-03 20:24:58 UTC (rev 611218)
@@ -1,24 +0,0 @@
-## @file
-# Linux DKMS config script for the VirtualBox guest kernel modules
-#
-
-#
-# Copyright (C) 2006-2010 Oracle Corporation
-#
-# This file is part of VirtualBox Open Source Edition (OSE), as
-# available from http://www.virtualbox.org. This file is free software;
-# you can redistribute it and/or modify it under the terms of the GNU
-# General Public License (GPL) as published by the Free Software
-# Foundation, in version 2 as it comes in the "COPYING" file of the
-# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-#
-
-PACKAGE_NAME="ndiswrapper"
-PACKAGE_VERSION=1.60.20160717
-AUTOINSTALL=yes
-
-BUILT_MODULE_NAME[0]="ndiswrapper"
-DEST_MODULE_LOCATION[0]="/kernel/net/ndiswrapper"
-MAKE[0]="make KVERS_UNAME=${kernelver}" 
-

Copied: ndiswrapper/repos/community-x86_64/dkms.conf (from rev 611217, ndiswrapper/trunk/dkms.conf)
===================================================================
--- dkms.conf	                        (rev 0)
+++ dkms.conf	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,24 @@
+## @file
+# Linux DKMS config script for the VirtualBox guest kernel modules
+#
+
+#
+# Copyright (C) 2006-2010 Oracle Corporation
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+PACKAGE_NAME="ndiswrapper"
+PACKAGE_VERSION=1.60.20160717
+AUTOINSTALL=yes
+
+BUILT_MODULE_NAME[0]="ndiswrapper"
+DEST_MODULE_LOCATION[0]="/kernel/net/ndiswrapper"
+MAKE[0]="make KVERS_UNAME=${kernelver}" 
+

Copied: ndiswrapper/repos/community-x86_64/kernel-5.3.patch (from rev 611217, ndiswrapper/trunk/kernel-5.3.patch)
===================================================================
--- kernel-5.3.patch	                        (rev 0)
+++ kernel-5.3.patch	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,69 @@
+diff --git a/ndiswrapper/driver/ntoskernel.c b/ndiswrapper/driver/ntoskernel.c
+index 4fe0dc1..4dd7a89 100644
+--- a/ndiswrapper/driver/ntoskernel.c
++++ b/ndiswrapper/driver/ntoskernel.c
+@@ -2524,7 +2524,11 @@ int ntoskernel_init(void)
+ 			info->task = NULL;
+ 			info->count = 0;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ 			cpumask_setall(&info->cpus_allowed);
++#else
++			cpumask_setall(&info->cpus_mask);
++#endif
+ #endif
+ 		}
+ 	} while (0);
+diff --git a/ndiswrapper/driver/ntoskernel.h b/ndiswrapper/driver/ntoskernel.h
+index 3c4c6ff..8a71ae3 100644
+--- a/ndiswrapper/driver/ntoskernel.h
++++ b/ndiswrapper/driver/ntoskernel.h
+@@ -107,7 +107,11 @@ static cpumask_t cpumasks[NR_CPUS];
+ #endif /* CONFIG_SMP */
+ 
+ #ifndef tsk_cpus_allowed
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
++#else
++#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_mask)
++#endif
+ #endif
+ 
+ #ifndef __packed
+@@ -631,7 +635,12 @@ struct irql_info {
+ 	int count;
+ 	struct mutex lock;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ 	cpumask_t cpus_allowed;
++#else
++	const cpumask_t	*cpus_ptr;
++	cpumask_t	cpus_mask;
++#endif
+ #endif
+ 	struct task_struct *task;
+ };
+@@ -658,7 +667,11 @@ static inline KIRQL raise_irql(KIRQL newirql)
+ 	/* TODO: is this enough to pin down to current cpu? */
+ #ifdef CONFIG_SMP
+ 	assert(task_cpu(current) == smp_processor_id());
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ 	cpumask_copy(&info->cpus_allowed, tsk_cpus_allowed(current));
++#else
++	cpumask_copy(&info->cpus_mask, tsk_cpus_allowed(current));
++#endif
+ 	set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
+ #endif
+ 	put_cpu_var(irql_info);
+@@ -682,7 +695,11 @@ static inline void lower_irql(KIRQL oldirql)
+ 	if (--info->count == 0) {
+ 		info->task = NULL;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ 		set_cpus_allowed_ptr(current, &info->cpus_allowed);
++#else
++		set_cpus_allowed_ptr(current, &info->cpus_mask);
++#endif
+ #endif
+ 		mutex_unlock(&info->lock);
+ 	}

Copied: ndiswrapper/repos/community-x86_64/kernel-5.4.patch (from rev 611217, ndiswrapper/trunk/kernel-5.4.patch)
===================================================================
--- kernel-5.4.patch	                        (rev 0)
+++ kernel-5.4.patch	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,22 @@
+diff -u -r ndiswrapper-1.62/driver/wrapndis.c ndiswrapper-1.62-5.4/driver/wrapndis.c
+--- ndiswrapper-1.62/driver/wrapndis.c	2019-02-11 04:11:14.000000000 +0000
++++ ndiswrapper-1.62-5.4/driver/wrapndis.c	2019-11-26 00:02:39.035464963 +0000
+@@ -457,10 +457,18 @@
+ 	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ 		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+ 		sg_element++;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
+ 		sg_element->length = frag->size;
++#else
++		sg_element->length = skb_frag_size(frag);
++#endif
+ 		sg_element->address =
+ 			pci_map_page(wnd->wd->pci.pdev, skb_frag_page(frag),
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
+ 				     frag->page_offset, frag->size,
++#else
++				     skb_frag_off(frag), skb_frag_size(frag),
++#endif
+ 				     PCI_DMA_TODEVICE);
+ 		TRACE3("%llx, %u", sg_element->address, sg_element->length);
+ 	}

Copied: ndiswrapper/repos/community-x86_64/kernel-5.5.patch (from rev 611217, ndiswrapper/trunk/kernel-5.5.patch)
===================================================================
--- kernel-5.5.patch	                        (rev 0)
+++ kernel-5.5.patch	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,72 @@
+diff -u -r ndiswrapper-1.62-5.4/driver/lin2win.S ndiswrapper-1.62-5.5/driver/lin2win.S
+--- ndiswrapper-1.62-5.4/driver/lin2win.S	2019-02-11 04:11:14.000000000 +0000
++++ ndiswrapper-1.62-5.5/driver/lin2win.S	2020-01-27 22:33:17.363779223 +0000
+@@ -14,6 +14,7 @@
+  */
+ 
+ #include <linux/linkage.h>
++#include <linux/version.h>
+ 
+ 	.text
+ 
+@@ -71,8 +72,12 @@
+  * We get (ARGC + 1) arguments.
+  */
+ .macro lin2win name, argc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ 	.type \name, @function
+ 	ENTRY(\name)
++#else
++	SYM_FUNC_START(\name)
++#endif
+ 
+ 	/* Create a call frame - it's optional, but good for debugging */
+ 	.cfi_startproc
+@@ -125,7 +130,11 @@
+ 	.cfi_restore %rbp
+ 	ret
+ 	.cfi_endproc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ 	.size	\name, (. - \name)
++#else
++	SYM_FUNC_END(\name)
++#endif
+ .endm
+ 
+ /* Define lin2winN functions */
+diff -u -r ndiswrapper-1.62-5.4/driver/win2lin_stubs.S ndiswrapper-1.62-5.5/driver/win2lin_stubs.S
+--- ndiswrapper-1.62-5.4/driver/win2lin_stubs.S	2019-02-11 04:11:14.000000000 +0000
++++ ndiswrapper-1.62-5.5/driver/win2lin_stubs.S	2020-01-27 22:33:20.867163026 +0000
+@@ -14,6 +14,7 @@
+  */
+ 
+ #include <linux/linkage.h>
++#include <linux/version.h>
+ 
+ #ifdef CONFIG_X86_64
+ 
+@@ -141,8 +142,12 @@
+ 
+ /* Declare function LONGNAME, call function SHORTNAME with ARGC arguments */
+ .macro win2linm longname, shortname, argc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ 	.type \longname, @function
+ 	ENTRY(\longname)
++#else
++	SYM_FUNC_START(\longname)
++#endif
+ 
+ 	/* Create a call frame - it's optional, but good for debugging */
+ 	.cfi_startproc
+@@ -243,7 +248,11 @@
+ 	.cfi_restore %rbp
+ 	ret
+ 	.cfi_endproc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ 	.size \longname, (. - \longname)
++#else
++	SYM_FUNC_END(\longname)
++#endif
+ .endm
+ 
+ #define win2lin(name, argc) win2linm win2lin_ ## name ## _ ## argc, name, argc

Copied: ndiswrapper/repos/community-x86_64/kernel-5.6.patch (from rev 611217, ndiswrapper/trunk/kernel-5.6.patch)
===================================================================
--- kernel-5.6.patch	                        (rev 0)
+++ kernel-5.6.patch	2020-04-03 20:24:58 UTC (rev 611218)
@@ -0,0 +1,85 @@
+diff --git a/driver/ntoskernel.c b/driver/ntoskernel.c
+index fccb28e..cd87740 100644
+--- a/driver/ntoskernel.c
++++ b/driver/ntoskernel.c
+@@ -1763,9 +1763,9 @@ wstdcall void __iomem *WIN_FUNC(MmMapIoSpace,3)
+ 	void __iomem *virt;
+ 	ENTER1("cache type: %d", cache);
+ 	if (cache == MmCached)
+-		virt = ioremap(phys_addr, size);
++		virt = ioremap_cache(phys_addr, size);
+ 	else
+-		virt = ioremap_nocache(phys_addr, size);
++		virt = ioremap(phys_addr, size);
+ 	TRACE1("%llx, %zu, %p", phys_addr, size, virt);
+ 	return virt;
+ }
+diff --git a/driver/proc.c b/driver/proc.c
+index 8a8cf2b..2622228 100644
+--- a/driver/proc.c
++++ b/driver/proc.c
+@@ -70,7 +70,11 @@ static inline void *PDE_DATA(const struct inode *inode)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+ static inline struct proc_dir_entry *proc_create_data(const char *name,
+ 	umode_t mode, struct proc_dir_entry *parent,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++	struct proc_ops *fops, void *data)
++#else
+ 	struct file_operations *fops, void *data)
++#endif
+ {
+ 	struct proc_dir_entry *de;
+ 
+@@ -86,7 +90,11 @@ static inline struct proc_dir_entry *proc_create_data(const char *name,
+ 
+ static int do_proc_make_entry(const char *name, umode_t mode,
+ 			      struct proc_dir_entry *parent,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++			      struct proc_ops *fops, kuid_t uid,
++#else
+ 			      struct file_operations *fops, kuid_t uid,
++#endif
+ 			      kgid_t gid, struct ndis_device *wnd)
+ {
+ 	struct proc_dir_entry *de;
+@@ -100,6 +108,32 @@ static int do_proc_make_entry(const char *name, umode_t mode,
+ 	return 0;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++#define PROC_DECLARE_RO(name) \
++	static int proc_##name##_open(struct inode *inode, struct file *file) \
++	{ \
++		return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
++	} \
++	static struct proc_ops name##_fops = { \
++		.proc_open = proc_##name##_open, \
++		.proc_read = seq_read, \
++		.proc_lseek = seq_lseek, \
++		.proc_release = single_release, \
++	};
++
++#define PROC_DECLARE_RW(name) \
++	static int proc_##name##_open(struct inode *inode, struct file *file) \
++	{ \
++		return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
++	} \
++	static struct proc_ops name##_fops = { \
++		.proc_open = proc_##name##_open, \
++		.proc_read = seq_read, \
++		.proc_lseek = seq_lseek, \
++		.proc_release = single_release, \
++		.proc_write = proc_##name##_write, \
++	};
++#else
+ #define PROC_DECLARE_RO(name) \
+ 	static int proc_##name##_open(struct inode *inode, struct file *file) \
+ 	{ \
+@@ -126,6 +160,7 @@ static int do_proc_make_entry(const char *name, umode_t mode,
+ 		.release = single_release, \
+ 		.write = proc_##name##_write, \
+ 	};
++#endif
+ 
+ #define proc_make_entry_ro(name, parent, wnd) \
+ 	do_proc_make_entry(#name, S_IFREG | S_IRUSR | S_IRGRP, parent, \

Deleted: linux-5.3.patch
===================================================================
--- linux-5.3.patch	2020-04-03 20:24:47 UTC (rev 611217)
+++ linux-5.3.patch	2020-04-03 20:24:58 UTC (rev 611218)
@@ -1,69 +0,0 @@
-diff --git a/ndiswrapper/driver/ntoskernel.c b/ndiswrapper/driver/ntoskernel.c
-index 4fe0dc1..4dd7a89 100644
---- a/ndiswrapper/driver/ntoskernel.c
-+++ b/ndiswrapper/driver/ntoskernel.c
-@@ -2524,7 +2524,11 @@ int ntoskernel_init(void)
- 			info->task = NULL;
- 			info->count = 0;
- #ifdef CONFIG_SMP
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
- 			cpumask_setall(&info->cpus_allowed);
-+#else
-+			cpumask_setall(&info->cpus_mask);
-+#endif
- #endif
- 		}
- 	} while (0);
-diff --git a/ndiswrapper/driver/ntoskernel.h b/ndiswrapper/driver/ntoskernel.h
-index 3c4c6ff..8a71ae3 100644
---- a/ndiswrapper/driver/ntoskernel.h
-+++ b/ndiswrapper/driver/ntoskernel.h
-@@ -107,7 +107,11 @@ static cpumask_t cpumasks[NR_CPUS];
- #endif /* CONFIG_SMP */
- 
- #ifndef tsk_cpus_allowed
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
- #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
-+#else
-+#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_mask)
-+#endif
- #endif
- 
- #ifndef __packed
-@@ -631,7 +635,12 @@ struct irql_info {
- 	int count;
- 	struct mutex lock;
- #ifdef CONFIG_SMP
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
- 	cpumask_t cpus_allowed;
-+#else
-+	const cpumask_t	*cpus_ptr;
-+	cpumask_t	cpus_mask;
-+#endif
- #endif
- 	struct task_struct *task;
- };
-@@ -658,7 +667,11 @@ static inline KIRQL raise_irql(KIRQL newirql)
- 	/* TODO: is this enough to pin down to current cpu? */
- #ifdef CONFIG_SMP
- 	assert(task_cpu(current) == smp_processor_id());
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
- 	cpumask_copy(&info->cpus_allowed, tsk_cpus_allowed(current));
-+#else
-+	cpumask_copy(&info->cpus_mask, tsk_cpus_allowed(current));
-+#endif
- 	set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
- #endif
- 	put_cpu_var(irql_info);
-@@ -682,7 +695,11 @@ static inline void lower_irql(KIRQL oldirql)
- 	if (--info->count == 0) {
- 		info->task = NULL;
- #ifdef CONFIG_SMP
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
- 		set_cpus_allowed_ptr(current, &info->cpus_allowed);
-+#else
-+		set_cpus_allowed_ptr(current, &info->cpus_mask);
-+#endif
- #endif
- 		mutex_unlock(&info->lock);
- 	}



More information about the arch-commits mailing list