From 710e91e455caf5cfec02892d667b41f312ec166c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 11 Oct 2010 17:09:20 -0400 Subject: m68knommu: Switch to saner sigsuspend Signed-off-by: Al Viro Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven --- arch/m68knommu/platform/68360/entry.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/m68knommu/platform/68360/entry.S') diff --git a/arch/m68knommu/platform/68360/entry.S b/arch/m68knommu/platform/68360/entry.S index c131c6e1d92..2a671da4af6 100644 --- a/arch/m68knommu/platform/68360/entry.S +++ b/arch/m68knommu/platform/68360/entry.S @@ -116,9 +116,8 @@ Lsignal_return: subql #4,%sp /* dummy return address*/ SAVE_SWITCH_STACK pea %sp@(SWITCH_STACK_SIZE) - clrl %sp@- bsrw do_signal - addql #8,%sp + addql #4,%sp RESTORE_SWITCH_STACK addql #4,%sp Lreturn: -- cgit v1.2.3-70-g09d2 From d1574df7e01d427c2ed80ada11433a72907ca472 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 11 Oct 2010 23:29:28 -0400 Subject: 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: Al Viro Acked-by: Greg Ungerer Signed-off-by: Geert Uytterhoeven --- arch/m68knommu/kernel/signal.c | 7 +++---- arch/m68knommu/platform/68328/entry.S | 4 ++-- arch/m68knommu/platform/68360/entry.S | 4 ++-- arch/m68knommu/platform/coldfire/entry.S | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'arch/m68knommu/platform/68360/entry.S') diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c index c973230dad8..c070f3f6425 100644 --- a/arch/m68knommu/kernel/signal.c +++ b/arch/m68knommu/kernel/signal.c @@ -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 * mistake. */ -asmlinkage int do_signal(struct pt_regs *regs) +asmlinkage void do_signal(struct pt_regs *regs) { struct k_sigaction ka; siginfo_t info; @@ -731,7 +731,7 @@ asmlinkage int do_signal(struct pt_regs *regs) * if so. */ if (!user_mode(regs)) - return 1; + return; if (test_thread_flag(TIF_RESTORE_SIGMASK)) oldset = ¤t->saved_sigmask; @@ -743,7 +743,7 @@ asmlinkage int do_signal(struct pt_regs *regs) /* Whee! Actually deliver the signal. */ handle_signal(signr, &ka, &info, oldset, regs); clear_thread_flag(TIF_RESTORE_SIGMASK); - return 1; + return; } /* Did we come from a system call? */ @@ -757,5 +757,4 @@ asmlinkage int do_signal(struct pt_regs *regs) clear_thread_flag(TIF_RESTORE_SIGMASK); sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); } - return 0; } diff --git a/arch/m68knommu/platform/68328/entry.S b/arch/m68knommu/platform/68328/entry.S index 6eeb635fab7..240a7a6e25c 100644 --- a/arch/m68knommu/platform/68328/entry.S +++ b/arch/m68knommu/platform/68328/entry.S @@ -106,6 +106,7 @@ Luser_return: movel %sp,%d1 /* get thread_info pointer */ andl #-THREAD_SIZE,%d1 movel %d1,%a2 +1: move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ andl #_TIF_WORK_MASK,%d1 jne Lwork_to_do @@ -124,8 +125,7 @@ Lsignal_return: addql #4,%sp RESTORE_SWITCH_STACK addql #4,%sp -Lreturn: - RESTORE_ALL + jra 1b /* * This is the main interrupt handler, responsible for calling process_int() diff --git a/arch/m68knommu/platform/68360/entry.S b/arch/m68knommu/platform/68360/entry.S index 2a671da4af6..8a28788c0ee 100644 --- a/arch/m68knommu/platform/68360/entry.S +++ b/arch/m68knommu/platform/68360/entry.S @@ -102,6 +102,7 @@ Luser_return: movel %sp,%d1 /* get thread_info pointer */ andl #-THREAD_SIZE,%d1 movel %d1,%a2 +1: move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ andl #_TIF_WORK_MASK,%d1 jne Lwork_to_do @@ -120,8 +121,7 @@ Lsignal_return: addql #4,%sp RESTORE_SWITCH_STACK addql #4,%sp -Lreturn: - RESTORE_ALL + jra 1b /* * This is the main interrupt handler, responsible for calling do_IRQ() diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S index ed2878829db..e1debc8285e 100644 --- a/arch/m68knommu/platform/coldfire/entry.S +++ b/arch/m68knommu/platform/coldfire/entry.S @@ -171,7 +171,7 @@ Lsignal_return: addql #4,%sp RESTORE_SWITCH_STACK addql #4,%sp - jmp Lreturn + jmp Luser_return /* * This is the generic interrupt handler (for all hardware interrupt -- cgit v1.2.3-70-g09d2 From b3e338de7e11d1e5bc4eca12833d894d1838b510 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 3 Feb 2011 11:17:55 +1000 Subject: m68knommu: fix use of un-defined _TIF_WORK_MASK The _TIF_WORK_MASK definition was removed in the clean up of MMU and non-MMU arch/m68k/include/asm/thread_info*.h files (this was commit cddafa3500fde4a07e5bf899ec97a04069f8f7ce, "merge MMU and non-MMU thread_info.h"). It didn't get cleaned out of the entry.S code for the 68328 and 68360 based platforms. And it was replaced by a hard coded constant mask for coldfire platforms. There is currently no need to mask any of these bits, so fix all uses (and former uses) to check for any non-zero value. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/68328/entry.S | 1 - arch/m68knommu/platform/68360/entry.S | 1 - arch/m68knommu/platform/coldfire/entry.S | 1 - 3 files changed, 3 deletions(-) (limited to 'arch/m68knommu/platform/68360/entry.S') diff --git a/arch/m68knommu/platform/68328/entry.S b/arch/m68knommu/platform/68328/entry.S index 240a7a6e25c..676960cf022 100644 --- a/arch/m68knommu/platform/68328/entry.S +++ b/arch/m68knommu/platform/68328/entry.S @@ -108,7 +108,6 @@ Luser_return: movel %d1,%a2 1: move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ - andl #_TIF_WORK_MASK,%d1 jne Lwork_to_do RESTORE_ALL diff --git a/arch/m68knommu/platform/68360/entry.S b/arch/m68knommu/platform/68360/entry.S index 8a28788c0ee..46c1b18c9dc 100644 --- a/arch/m68knommu/platform/68360/entry.S +++ b/arch/m68knommu/platform/68360/entry.S @@ -104,7 +104,6 @@ Luser_return: movel %d1,%a2 1: move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ - andl #_TIF_WORK_MASK,%d1 jne Lwork_to_do RESTORE_ALL diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S index 4ddfc3da70d..5837cf080b6 100644 --- a/arch/m68knommu/platform/coldfire/entry.S +++ b/arch/m68knommu/platform/coldfire/entry.S @@ -138,7 +138,6 @@ Luser_return: andl #-THREAD_SIZE,%d1 /* at base of kernel stack */ movel %d1,%a0 movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */ - andl #0xefff,%d1 jne Lwork_to_do /* still work to do */ Lreturn: -- cgit v1.2.3-70-g09d2