From de8f2ddd69fc817b66138b36d656a2973d6afd8a Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 11 May 2012 10:58:03 +1000 Subject: microblaze: don't reimplement force_sigsegv() Instead of open coding the sequence from force_sigsegv() just call it. This also fixes a bug because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]), whereas the intention of the code was to modify sighand->action[] directly. As the original code was working with a copy it had no effect on signal delivery. Acked-by: Oleg Nesterov Acked-by: Michal Simek Signed-off-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- arch/microblaze/kernel/signal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 599671168980..90de06da3f6f 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -270,9 +270,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, return; give_sigsegv: - if (sig == SIGSEGV) - ka->sa.sa_handler = SIG_DFL; - force_sig(SIGSEGV, current); + force_sigsegv(sig, current); } /* Handle restarting system calls */ -- cgit v1.2.3 From a12c3694aeb0321d5e6a50321c63881bd92a1bf2 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 11 May 2012 10:58:04 +1000 Subject: microblaze: no need to reset handler if SA_ONESHOT get_signal_to_deliver() already resets the signal handler if SA_ONESHOT is set in ka->sa.sa_flags, there's no need to do it again in handle_signal(). Furthermore, because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]) instead of sighand->action[] the original code actually had no effect on signal delivery. Acked-by: Oleg Nesterov Acked-by: Michal Simek Signed-off-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- arch/microblaze/kernel/signal.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 90de06da3f6f..9e749c032af8 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -320,9 +320,6 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, else setup_rt_frame(sig, ka, NULL, oldset, regs); - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; - if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, -- cgit v1.2.3 From bcb8c8d0b7131df1b5aad011db33e17f8def5d0b Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 11 May 2012 10:58:04 +1000 Subject: microblaze: fix signal masking There are a couple of problems with the current signal code, 1. If we failed to setup the signal stack frame then we should not be masking any signals. 2. ka->sa.sa_mask is only added to the current blocked signals list if SA_NODEFER is set in ka->sa.sa_flags. If we successfully setup the signal frame and are going to run the handler then we must honour sa_mask. Acked-by: Oleg Nesterov Acked-by: Michal Simek Signed-off-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- arch/microblaze/kernel/signal.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 9e749c032af8..f2c13d5a6261 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -169,7 +169,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) return (void __user *)((sp - frame_size) & -8UL); } -static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, +static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { struct rt_sigframe __user *frame; @@ -267,10 +267,11 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, current->comm, current->pid, frame, regs->pc); #endif - return; + return 0; give_sigsegv: force_sigsegv(sig, current); + return -EFAULT; } /* Handle restarting system calls */ @@ -314,21 +315,25 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) { + int ret; + /* Set up the stack frame */ if (ka->sa.sa_flags & SA_SIGINFO) - setup_rt_frame(sig, ka, info, oldset, regs); + ret = setup_rt_frame(sig, ka, info, oldset, regs); else - setup_rt_frame(sig, ka, NULL, oldset, regs); + ret = setup_rt_frame(sig, ka, NULL, oldset, regs); + + if (ret) + return ret; - if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sighand->siglock); - sigorsets(¤t->blocked, - ¤t->blocked, &ka->sa.sa_mask); + spin_lock_irq(¤t->sighand->siglock); + sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) sigaddset(¤t->blocked, sig); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - } - return 1; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + + return 0; } /* @@ -369,7 +374,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) /* Whee! Actually deliver the signal. */ if (in_syscall) handle_restart(regs, &ka, 1); - if (handle_signal(signr, &ka, &info, oldset, regs)) { + if (!handle_signal(signr, &ka, &info, oldset, regs)) { /* * A signal was successfully delivered; the saved * sigmask will have been stored in the signal frame, -- cgit v1.2.3 From 60c597513ee93fc6a0b7f2cb83d0aa67d4204cf1 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 11 May 2012 10:58:05 +1000 Subject: microblaze: use set_current_blocked() and block_sigmask() As described in e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0f28f ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Acked-by: Oleg Nesterov Acked-by: Michal Simek Signed-off-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- arch/microblaze/kernel/signal.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index f2c13d5a6261..99b970866b29 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -105,10 +105,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sighand->siglock); - current->blocked = set; - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); + set_current_blocked(&set); if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) goto badframe; @@ -326,12 +323,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, if (ret) return ret; - spin_lock_irq(¤t->sighand->siglock); - sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); - if (!(ka->sa.sa_flags & SA_NODEFER)) - sigaddset(¤t->blocked, sig); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); + block_sigmask(ka, sig); return 0; } -- cgit v1.2.3 From 58e4257bc6336db015673a8cb598bd6cdbecf6d1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 22 Apr 2012 03:32:18 -0400 Subject: microblaze: ->restart_block.fn needs to be reset on rt_sigreturn Signed-off-by: Al Viro --- arch/microblaze/kernel/signal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 99b970866b29..fbdb02641821 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -98,6 +98,9 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) sigset_t set; int rval; + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; -- cgit v1.2.3 From ae28b38ca14122b990a83bf4ef95a12889cc6b92 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 22 Apr 2012 00:28:50 -0400 Subject: microblaze: bury sys_rt_sigsuspend_wrapper in nommu case too It's been a dead code since commit 571202f50fad0aeb36661c79de9beed052347df8 Author: Michal Simek Date: Fri Dec 11 12:54:04 2009 +0100 microblaze: Remove rt_sigsuspend wrapper Generic rt_sigsuspend syscalls doesn't need any asm wrapper. but that commit has only removed it from entry.S, missing one in entry-nommu.S. Signed-off-by: Al Viro --- arch/microblaze/kernel/entry-nommu.S | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S index 34b526f59b43..f104d276b806 100644 --- a/arch/microblaze/kernel/entry-nommu.S +++ b/arch/microblaze/kernel/entry-nommu.S @@ -569,10 +569,6 @@ sys_rt_sigreturn_wrapper: brid sys_rt_sigreturn addk r5, r1, r0 -sys_rt_sigsuspend_wrapper: - brid sys_rt_sigsuspend - addk r7, r1, r0 - /* Interrupt vector table */ .section .init.ivt, "ax" .org 0x0 -- cgit v1.2.3 From 969a96168091f837645a674a9f7ed1a9aaa1424b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 24 Apr 2012 02:03:06 -0400 Subject: microblaze: handle TIF_NOTIFY_RESUME Signed-off-by: Al Viro --- arch/microblaze/kernel/entry-nommu.S | 12 ++++++------ arch/microblaze/kernel/entry.S | 18 +++++++++--------- arch/microblaze/kernel/signal.c | 34 +++++++++++++++++++++++----------- 3 files changed, 38 insertions(+), 26 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S index f104d276b806..ea2dd42fdc22 100644 --- a/arch/microblaze/kernel/entry-nommu.S +++ b/arch/microblaze/kernel/entry-nommu.S @@ -132,11 +132,11 @@ ret_from_intr: beqi r11, 1f bralid r15, schedule nop -1: andi r11, r19, _TIF_SIGPENDING +1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME beqid r11, no_intr_resched addk r5, r1, r0 addk r7, r0, r0 - bralid r15, do_signal + bralid r15, do_notify_resume addk r6, r0, r0 no_intr_resched: @@ -292,8 +292,8 @@ ENTRY(_user_exception) /* * Debug traps are like a system call, but entered via brki r14, 0x60 - * All we need to do is send the SIGTRAP signal to current, ptrace and do_signal - * will handle the rest + * All we need to do is send the SIGTRAP signal to current, ptrace and + * do_notify_resume will handle the rest */ ENTRY(_debug_exception) swi r1, r0, PER_CPU(ENTRY_SP) /* save the current sp */ @@ -482,11 +482,11 @@ work_pending: beqi r11, 1f bralid r15, schedule nop -1: andi r11, r19, _TIF_SIGPENDING +1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME beqi r11, no_work_pending addk r5, r1, r0 addik r7, r0, 1 - bralid r15, do_signal + bralid r15, do_notify_resume addk r6, r0, r0 bri no_work_pending diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 66e34a3bfe1b..3cee9130a392 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S @@ -430,12 +430,12 @@ C_ENTRY(ret_from_trap): 5: /* get thread info from current task*/ lwi r11, CURRENT_TASK, TS_THREAD_INFO; lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING; + andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqi r11, 1f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ addi r7, r0, 1; /* Arg 3: int in_syscall */ - bralid r15, do_signal; /* Handle any signals */ + bralid r15, do_notify_resume; /* Handle any signals */ add r6, r0, r0; /* Arg 2: sigset_t *oldset */ /* Finally, return to user state. */ @@ -622,7 +622,7 @@ C_ENTRY(ret_from_exc): /* Maybe handle a signal */ 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING; + andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqi r11, 1f; /* Signals to handle, handle them */ /* @@ -635,10 +635,10 @@ C_ENTRY(ret_from_exc): * traps), but signal handlers may want to examine or change the * complete register state. Here we save anything not saved by * the normal entry sequence, so that it may be safely restored - * (in a possibly modified form) after do_signal returns. */ + * (in a possibly modified form) after do_notify_resume returns. */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ addi r7, r0, 0; /* Arg 3: int in_syscall */ - bralid r15, do_signal; /* Handle any signals */ + bralid r15, do_notify_resume; /* Handle any signals */ add r6, r0, r0; /* Arg 2: sigset_t *oldset */ /* Finally, return to user state. */ @@ -732,12 +732,12 @@ ret_from_irq: /* Maybe handle a signal */ 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* MS: get thread info */ lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING; + andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqid r11, no_intr_resched /* Handle a signal return; Pending signals should be in r18. */ addi r7, r0, 0; /* Arg 3: int in_syscall */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ - bralid r15, do_signal; /* Handle any signals */ + bralid r15, do_notify_resume; /* Handle any signals */ add r6, r0, r0; /* Arg 2: sigset_t *oldset */ /* Finally, return to user state. */ @@ -869,12 +869,12 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */ /* Maybe handle a signal */ 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING; + andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqi r11, 1f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ addi r7, r0, 0; /* Arg 3: int in_syscall */ - bralid r15, do_signal; /* Handle any signals */ + bralid r15, do_notify_resume; /* Handle any signals */ add r6, r0, r0; /* Arg 2: sigset_t *oldset */ /* Finally, return to user state. */ diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index fbdb02641821..449886db35a2 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,6 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); - asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, struct pt_regs *regs) @@ -340,7 +339,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, * the kernel can handle, and then we build all the user-level signal handling * stack-frames in one go after that. */ -int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) +static int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) { siginfo_t info; int signr; @@ -350,14 +349,6 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) printk(KERN_INFO "do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1, regs->r12, current_thread_info()->flags); #endif - /* - * We want the common case to go fast, which - * is why we may in certain cases get here from - * kernel mode. Just return without doing anything - * if so. - */ - if (kernel_mode(regs)) - return 1; if (current_thread_info()->status & TS_RESTORE_SIGMASK) oldset = ¤t->saved_sigmask; @@ -397,3 +388,24 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) /* Did we come from a system call? */ return 0; } + +void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, int in_syscall) +{ + /* + * We want the common case to go fast, which + * is why we may in certain cases get here from + * kernel mode. Just return without doing anything + * if so. + */ + if (kernel_mode(regs)) + return; + + if (test_thread_flag(TIF_SIGPENDING)) + do_signal(regs, oldset, in_syscall); + + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) { + tracehook_notify_resume(regs); + if (current->replacement_session_keyring) + key_replace_session_keyring(); + } +} -- cgit v1.2.3 From 8314019141e4f7274ea4dc264a47bbb2e17c66dd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 24 Apr 2012 02:21:18 -0400 Subject: microblaze: drop 'oldset' argument of do_notify_resume() never used... Signed-off-by: Al Viro --- arch/microblaze/kernel/entry-nommu.S | 4 +--- arch/microblaze/kernel/entry.S | 12 ++++-------- arch/microblaze/kernel/signal.c | 14 ++++++-------- 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'arch/microblaze/kernel') diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S index ea2dd42fdc22..75c3ea1f48a1 100644 --- a/arch/microblaze/kernel/entry-nommu.S +++ b/arch/microblaze/kernel/entry-nommu.S @@ -135,7 +135,6 @@ ret_from_intr: 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME beqid r11, no_intr_resched addk r5, r1, r0 - addk r7, r0, r0 bralid r15, do_notify_resume addk r6, r0, r0 @@ -485,9 +484,8 @@ work_pending: 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME beqi r11, no_work_pending addk r5, r1, r0 - addik r7, r0, 1 bralid r15, do_notify_resume - addk r6, r0, r0 + addik r6, r0, 1 bri no_work_pending ENTRY(ret_to_user) diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 3cee9130a392..daff9e5e4a1f 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S @@ -434,9 +434,8 @@ C_ENTRY(ret_from_trap): beqi r11, 1f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ - addi r7, r0, 1; /* Arg 3: int in_syscall */ bralid r15, do_notify_resume; /* Handle any signals */ - add r6, r0, r0; /* Arg 2: sigset_t *oldset */ + addi r6, r0, 1; /* Arg 2: int in_syscall */ /* Finally, return to user state. */ 1: set_bip; /* Ints masked for state restore */ @@ -637,9 +636,8 @@ C_ENTRY(ret_from_exc): * the normal entry sequence, so that it may be safely restored * (in a possibly modified form) after do_notify_resume returns. */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ - addi r7, r0, 0; /* Arg 3: int in_syscall */ bralid r15, do_notify_resume; /* Handle any signals */ - add r6, r0, r0; /* Arg 2: sigset_t *oldset */ + addi r6, r0, 0; /* Arg 2: int in_syscall */ /* Finally, return to user state. */ 1: set_bip; /* Ints masked for state restore */ @@ -735,10 +733,9 @@ ret_from_irq: andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqid r11, no_intr_resched /* Handle a signal return; Pending signals should be in r18. */ - addi r7, r0, 0; /* Arg 3: int in_syscall */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ bralid r15, do_notify_resume; /* Handle any signals */ - add r6, r0, r0; /* Arg 2: sigset_t *oldset */ + addi r6, r0, 0; /* Arg 2: int in_syscall */ /* Finally, return to user state. */ no_intr_resched: @@ -873,9 +870,8 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */ beqi r11, 1f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ - addi r7, r0, 0; /* Arg 3: int in_syscall */ bralid r15, do_notify_resume; /* Handle any signals */ - add r6, r0, r0; /* Arg 2: sigset_t *oldset */ + addi r6, r0, 0; /* Arg 2: int in_syscall */ /* Finally, return to user state. */ 1: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 449886db35a2..7f4c7bef1642 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -339,13 +339,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, * the kernel can handle, and then we build all the user-level signal handling * stack-frames in one go after that. */ -static int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) +static void do_signal(struct pt_regs *regs, int in_syscall) { siginfo_t info; int signr; struct k_sigaction ka; + sigset_t *oldset; #ifdef DEBUG_SIG - printk(KERN_INFO "do signal: %p %p %d\n", regs, oldset, in_syscall); + printk(KERN_INFO "do signal: %p %d\n", regs, in_syscall); printk(KERN_INFO "do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1, regs->r12, current_thread_info()->flags); #endif @@ -370,7 +371,7 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) current_thread_info()->status &= ~TS_RESTORE_SIGMASK; } - return 1; + return; } if (in_syscall) @@ -384,12 +385,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) current_thread_info()->status &= ~TS_RESTORE_SIGMASK; sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); } - - /* Did we come from a system call? */ - return 0; } -void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, int in_syscall) +void do_notify_resume(struct pt_regs *regs, int in_syscall) { /* * We want the common case to go fast, which @@ -401,7 +399,7 @@ void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, int in_syscall) return; if (test_thread_flag(TIF_SIGPENDING)) - do_signal(regs, oldset, in_syscall); + do_signal(regs, in_syscall); if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) { tracehook_notify_resume(regs); -- cgit v1.2.3