Skip to content

Commit f50a705

Browse files
committed
sparc: add support for TIF_NOTIFY_SIGNAL
Wire up TIF_NOTIFY_SIGNAL handling for sparc. Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 24a31b8 commit f50a705

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

arch/sparc/include/asm/thread_info_32.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
104104
#define TIF_SIGPENDING 2 /* signal pending */
105105
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
106106
#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
107+
#define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */
107108
#define TIF_USEDFPU 8 /* FPU was used by this task
108109
* this quantum (SMP) */
109110
#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
@@ -115,11 +116,12 @@ register struct thread_info *current_thread_info_reg asm("g6");
115116
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
116117
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
117118
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
119+
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
118120
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
119121
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
120122

121123
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
122-
_TIF_SIGPENDING)
124+
_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)
123125

124126
#define is_32bit_task() (1)
125127

arch/sparc/include/asm/thread_info_64.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ extern struct thread_info *current_thread_info(void);
180180
#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
181181
#define TIF_SIGPENDING 2 /* signal pending */
182182
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
183-
/* flag bit 4 is available */
183+
#define TIF_NOTIFY_SIGNAL 4 /* signal notifications exist */
184184
#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */
185185
#define TIF_UPROBE 6 /* breakpointed or singlestepped */
186186
#define TIF_32BIT 7 /* 32-bit binary */
@@ -200,6 +200,7 @@ extern struct thread_info *current_thread_info(void);
200200
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
201201
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
202202
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
203+
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
203204
#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)
204205
#define _TIF_UPROBE (1<<TIF_UPROBE)
205206
#define _TIF_32BIT (1<<TIF_32BIT)
@@ -213,7 +214,8 @@ extern struct thread_info *current_thread_info(void);
213214
_TIF_DO_NOTIFY_RESUME_MASK | \
214215
_TIF_NEED_RESCHED)
215216
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
216-
_TIF_SIGPENDING | _TIF_UPROBE)
217+
_TIF_SIGPENDING | _TIF_UPROBE | \
218+
_TIF_NOTIFY_SIGNAL)
217219

218220
#define is_32bit_task() (test_thread_flag(TIF_32BIT))
219221

arch/sparc/kernel/signal_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
521521
void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
522522
unsigned long thread_info_flags)
523523
{
524-
if (thread_info_flags & _TIF_SIGPENDING)
524+
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
525525
do_signal(regs, orig_i0);
526526
if (thread_info_flags & _TIF_NOTIFY_RESUME)
527527
tracehook_notify_resume(regs);

arch/sparc/kernel/signal_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long
549549
user_exit();
550550
if (thread_info_flags & _TIF_UPROBE)
551551
uprobe_notify_resume(regs);
552-
if (thread_info_flags & _TIF_SIGPENDING)
552+
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
553553
do_signal(regs, orig_i0);
554554
if (thread_info_flags & _TIF_NOTIFY_RESUME)
555555
tracehook_notify_resume(regs);

0 commit comments

Comments
 (0)