Skip to content

Commit 3136b93

Browse files
krisman-at-collaboraKAGA-KOKO
authored andcommitted
entry: Expose helpers to migrate TIF to SYSCALL_WORK flags
With the goal to split the syscall work related flags into a separate field that is architecture independent, expose transitional helpers that resolve to either the TIF flags or to the corresponding SYSCALL_WORK flags. This will allow architectures to migrate only when they port to the generic syscall entry code. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Andy Lutomirski <luto@kernel.org> Link: https://lore.kernel.org/r/20201116174206.2639648-3-krisman@collabora.com
1 parent b4581a5 commit 3136b93

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎include/linux/thread_info.h‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,38 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
9797
#define test_thread_flag(flag) \
9898
test_ti_thread_flag(current_thread_info(), flag)
9999

100+
#ifdef CONFIG_GENERIC_ENTRY
101+
#define set_syscall_work(fl) \
102+
set_bit(SYSCALL_WORK_BIT_##fl, &current_thread_info()->syscall_work)
103+
#define test_syscall_work(fl) \
104+
test_bit(SYSCALL_WORK_BIT_##fl, &current_thread_info()->syscall_work)
105+
#define clear_syscall_work(fl) \
106+
clear_bit(SYSCALL_WORK_BIT_##fl, &current_thread_info()->syscall_work)
107+
108+
#define set_task_syscall_work(t, fl) \
109+
set_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
110+
#define test_task_syscall_work(t, fl) \
111+
test_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
112+
#define clear_task_syscall_work(t, fl) \
113+
clear_bit(SYSCALL_WORK_BIT_##fl, &task_thread_info(t)->syscall_work)
114+
115+
#else /* CONFIG_GENERIC_ENTRY */
116+
117+
#define set_syscall_work(fl) \
118+
set_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
119+
#define test_syscall_work(fl) \
120+
test_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
121+
#define clear_syscall_work(fl) \
122+
clear_ti_thread_flag(current_thread_info(), SYSCALL_WORK_##fl)
123+
124+
#define set_task_syscall_work(t, fl) \
125+
set_ti_thread_flag(task_thread_info(t), TIF_##fl)
126+
#define test_task_syscall_work(t, fl) \
127+
test_ti_thread_flag(task_thread_info(t), TIF_##fl)
128+
#define clear_task_syscall_work(t, fl) \
129+
clear_ti_thread_flag(task_thread_info(t), TIF_##fl)
130+
#endif /* !CONFIG_GENERIC_ENTRY */
131+
100132
#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
101133

102134
#ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES

0 commit comments

Comments
 (0)