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/file.h>
#include <linux/fs.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, 4, 0)
#include <linux/input-event-codes.h>
#else
@@ -253,7 +256,11 @@ first_app_process:
rcu_read_lock();
init_task = rcu_dereference(current->parent);
if (init_task) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
task_work_add(init_task, &on_post_fs_data_cb, TWA_RESUME);
#else
task_work_add(init_task, &on_post_fs_data_cb, true);
#endif
}
rcu_read_unlock();