Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arc: add support for TIF_NOTIFY_SIGNAL

Wire up TIF_NOTIFY_SIGNAL handling for arc.

Cc: linux-snps-arc@lists.infradead.org
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+6 -3
+3 -1
arch/arc/include/asm/thread_info.h
··· 79 79 #define TIF_SIGPENDING 2 /* signal pending */ 80 80 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 81 81 #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ 82 + #define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */ 82 83 #define TIF_SYSCALL_TRACE 15 /* syscall trace active */ 83 84 84 85 /* true if poll_idle() is polling TIF_NEED_RESCHED */ ··· 90 89 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 91 90 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 92 91 #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 92 + #define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL) 93 93 #define _TIF_MEMDIE (1<<TIF_MEMDIE) 94 94 95 95 /* work to do on interrupt/exception return */ 96 96 #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ 97 - _TIF_NOTIFY_RESUME) 97 + _TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL) 98 98 99 99 /* 100 100 * _TIF_ALLWORK_MASK includes SYSCALL_TRACE, but we don't need it.
+2 -1
arch/arc/kernel/entry.S
··· 307 307 mov r0, sp ; pt_regs for arg to do_signal()/do_notify_resume() 308 308 309 309 GET_CURR_THR_INFO_FLAGS r9 310 - bbit0 r9, TIF_SIGPENDING, .Lchk_notify_resume 310 + and.f 0, r9, TIF_SIGPENDING|TIF_NOTIFY_SIGNAL 311 + bz .Lchk_notify_resume 311 312 312 313 ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs 313 314 ; in pt_reg since the "C" ABI (kernel code) will automatically
+1 -1
arch/arc/kernel/signal.c
··· 362 362 363 363 restart_scall = in_syscall(regs) && syscall_restartable(regs); 364 364 365 - if (get_signal(&ksig)) { 365 + if (test_thread_flag(TIF_SIGPENDING) && get_signal(&ksig)) { 366 366 if (restart_scall) { 367 367 arc_restart_syscall(&ksig.ka, regs); 368 368 syscall_wont_restart(regs); /* No more restarts */