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)
9 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
10 cpumask_setall(&info->cpus_allowed);
12 + cpumask_setall(&info->cpus_mask);
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)
28 +#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_mask)
33 @@ -631,7 +635,12 @@ struct irql_info {
37 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
38 cpumask_t cpus_allowed;
40 + const cpumask_t *cpus_ptr;
41 + cpumask_t cpus_mask;
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? */
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));
53 + cpumask_copy(&info->cpus_mask, tsk_cpus_allowed(current));
55 set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
57 put_cpu_var(irql_info);
58 @@ -682,7 +695,11 @@ static inline void lower_irql(KIRQL oldirql)
59 if (--info->count == 0) {
62 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
63 set_cpus_allowed_ptr(current, &info->cpus_allowed);
65 + set_cpus_allowed_ptr(current, &info->cpus_mask);
68 mutex_unlock(&info->lock);