kernel: Fix compilation for non-gki kernels

Co-authored-by: TwinbornPlate75 <3342733415@qq.com>
This commit is contained in:
ShirkNeko
2025-11-09 13:35:42 +08:00
parent a525048d1f
commit 3e5f69cdf8
4 changed files with 31 additions and 11 deletions

View File

@@ -10,6 +10,9 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
#include <linux/sched/task.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
#include <linux/compiler_types.h>
#endif
@@ -418,7 +421,11 @@ void persistent_allow_list()
goto put_task;
}
cb->func = do_persistent_allow_list;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
task_work_add(tsk, cb, TWA_RESUME);
#else
task_work_add(tsk, cb, true);
#endif
put_task:
put_task_struct(tsk);