upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / ndiswrapper / trunk / kernel-5.3.patch
blob33e3ed3ba4469d50cc0310118f9009371933f1f0
1 diff --git a/ndiswrapper/driver/ntoskernel.c b/ndiswrapper/driver/ntoskernel.c
2 index 4fe0dc1..4dd7a89 100644
3 --- a/ndiswrapper/driver/ntoskernel.c
4 +++ b/ndiswrapper/driver/ntoskernel.c
5 @@ -2524,7 +2524,11 @@ int ntoskernel_init(void)
6 info->task = NULL;
7 info->count = 0;
8 #ifdef CONFIG_SMP
9 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
10 cpumask_setall(&info->cpus_allowed);
11 +#else
12 + cpumask_setall(&info->cpus_mask);
13 +#endif
14 #endif
16 } while (0);
17 diff --git a/ndiswrapper/driver/ntoskernel.h b/ndiswrapper/driver/ntoskernel.h
18 index 3c4c6ff..8a71ae3 100644
19 --- a/ndiswrapper/driver/ntoskernel.h
20 +++ b/ndiswrapper/driver/ntoskernel.h
21 @@ -107,7 +107,11 @@ static cpumask_t cpumasks[NR_CPUS];
22 #endif /* CONFIG_SMP */
24 #ifndef tsk_cpus_allowed
25 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
26 #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
27 +#else
28 +#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_mask)
29 +#endif
30 #endif
32 #ifndef __packed
33 @@ -631,7 +635,12 @@ struct irql_info {
34 int count;
35 struct mutex lock;
36 #ifdef CONFIG_SMP
37 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
38 cpumask_t cpus_allowed;
39 +#else
40 + const cpumask_t *cpus_ptr;
41 + cpumask_t cpus_mask;
42 +#endif
43 #endif
44 struct task_struct *task;
46 @@ -658,7 +667,11 @@ static inline KIRQL raise_irql(KIRQL newirql)
47 /* TODO: is this enough to pin down to current cpu? */
48 #ifdef CONFIG_SMP
49 assert(task_cpu(current) == smp_processor_id());
50 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
51 cpumask_copy(&info->cpus_allowed, tsk_cpus_allowed(current));
52 +#else
53 + cpumask_copy(&info->cpus_mask, tsk_cpus_allowed(current));
54 +#endif
55 set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
56 #endif
57 put_cpu_var(irql_info);
58 @@ -682,7 +695,11 @@ static inline void lower_irql(KIRQL oldirql)
59 if (--info->count == 0) {
60 info->task = NULL;
61 #ifdef CONFIG_SMP
62 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
63 set_cpus_allowed_ptr(current, &info->cpus_allowed);
64 +#else
65 + set_cpus_allowed_ptr(current, &info->cpus_mask);
66 +#endif
67 #endif
68 mutex_unlock(&info->lock);