提交 d1574df7 编写于 作者: A Al Viro 提交者: Geert Uytterhoeven

m68knommu: Handle multiple pending signals

we shouldn't bugger off to userland when there still are
pending signals; among other things it makes e.g. SIGSEGV
triggered by failure to build a sigframe to be delivered
_now_ and not when we hit the next syscall or interrupt.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Acked-by: NGreg Ungerer <gerg@uclinux.org>
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
上级 710e91e4
...@@ -717,7 +717,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -717,7 +717,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
* want to handle. Thus you cannot kill init even with a SIGKILL even by * want to handle. Thus you cannot kill init even with a SIGKILL even by
* mistake. * mistake.
*/ */
asmlinkage int do_signal(struct pt_regs *regs) asmlinkage void do_signal(struct pt_regs *regs)
{ {
struct k_sigaction ka; struct k_sigaction ka;
siginfo_t info; siginfo_t info;
...@@ -731,7 +731,7 @@ asmlinkage int do_signal(struct pt_regs *regs) ...@@ -731,7 +731,7 @@ asmlinkage int do_signal(struct pt_regs *regs)
* if so. * if so.
*/ */
if (!user_mode(regs)) if (!user_mode(regs))
return 1; return;
if (test_thread_flag(TIF_RESTORE_SIGMASK)) if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask; oldset = &current->saved_sigmask;
...@@ -743,7 +743,7 @@ asmlinkage int do_signal(struct pt_regs *regs) ...@@ -743,7 +743,7 @@ asmlinkage int do_signal(struct pt_regs *regs)
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &ka, &info, oldset, regs); handle_signal(signr, &ka, &info, oldset, regs);
clear_thread_flag(TIF_RESTORE_SIGMASK); clear_thread_flag(TIF_RESTORE_SIGMASK);
return 1; return;
} }
/* Did we come from a system call? */ /* Did we come from a system call? */
...@@ -757,5 +757,4 @@ asmlinkage int do_signal(struct pt_regs *regs) ...@@ -757,5 +757,4 @@ asmlinkage int do_signal(struct pt_regs *regs)
clear_thread_flag(TIF_RESTORE_SIGMASK); clear_thread_flag(TIF_RESTORE_SIGMASK);
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
} }
return 0;
} }
...@@ -106,6 +106,7 @@ Luser_return: ...@@ -106,6 +106,7 @@ Luser_return:
movel %sp,%d1 /* get thread_info pointer */ movel %sp,%d1 /* get thread_info pointer */
andl #-THREAD_SIZE,%d1 andl #-THREAD_SIZE,%d1
movel %d1,%a2 movel %d1,%a2
1:
move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
andl #_TIF_WORK_MASK,%d1 andl #_TIF_WORK_MASK,%d1
jne Lwork_to_do jne Lwork_to_do
...@@ -124,8 +125,7 @@ Lsignal_return: ...@@ -124,8 +125,7 @@ Lsignal_return:
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
Lreturn: jra 1b
RESTORE_ALL
/* /*
* This is the main interrupt handler, responsible for calling process_int() * This is the main interrupt handler, responsible for calling process_int()
......
...@@ -102,6 +102,7 @@ Luser_return: ...@@ -102,6 +102,7 @@ Luser_return:
movel %sp,%d1 /* get thread_info pointer */ movel %sp,%d1 /* get thread_info pointer */
andl #-THREAD_SIZE,%d1 andl #-THREAD_SIZE,%d1
movel %d1,%a2 movel %d1,%a2
1:
move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
andl #_TIF_WORK_MASK,%d1 andl #_TIF_WORK_MASK,%d1
jne Lwork_to_do jne Lwork_to_do
...@@ -120,8 +121,7 @@ Lsignal_return: ...@@ -120,8 +121,7 @@ Lsignal_return:
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
Lreturn: jra 1b
RESTORE_ALL
/* /*
* This is the main interrupt handler, responsible for calling do_IRQ() * This is the main interrupt handler, responsible for calling do_IRQ()
......
...@@ -171,7 +171,7 @@ Lsignal_return: ...@@ -171,7 +171,7 @@ Lsignal_return:
addql #4,%sp addql #4,%sp
RESTORE_SWITCH_STACK RESTORE_SWITCH_STACK
addql #4,%sp addql #4,%sp
jmp Lreturn jmp Luser_return
/* /*
* This is the generic interrupt handler (for all hardware interrupt * This is the generic interrupt handler (for all hardware interrupt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册