diff options
Diffstat (limited to 'arch/hexagon/kernel/signal.c')
| -rw-r--r-- | arch/hexagon/kernel/signal.c | 54 | 
1 files changed, 12 insertions, 42 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index ecbab345760..304b0808d07 100644 --- a/arch/hexagon/kernel/signal.c +++ b/arch/hexagon/kernel/signal.c @@ -31,8 +31,6 @@  #include <asm/signal.h>  #include <asm/vdso.h> -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -  struct rt_sigframe {  	unsigned long tramp[2];  	struct siginfo info; @@ -149,11 +147,9 @@ sigsegv:  /*   * Setup invocation of signal handler   */ -static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, -			 sigset_t *oldset, struct pt_regs *regs) +static void handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, +			 struct pt_regs *regs)  { -	int rc; -  	/*  	 * If we're handling a signal that aborted a system call,  	 * set up the error return value before adding the signal @@ -186,15 +182,12 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,  	 * Set up the stack frame; not doing the SA_SIGINFO thing.  We  	 * only set up the rt_frame flavor.  	 */ -	rc = setup_rt_frame(sig, ka, info, oldset, regs); -  	/* If there was an error on setup, no signal was delivered. */ -	if (rc) -		return rc; - -	block_sigmask(ka, sig); +	if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs) < 0) +		return; -	return 0; +	signal_delivered(sig, info, ka, regs, +			test_thread_flag(TIF_SINGLESTEP));  }  /* @@ -209,34 +202,13 @@ static void do_signal(struct pt_regs *regs)  	if (!user_mode(regs))  		return; -	if (try_to_freeze()) -		goto no_signal; -  	signo = get_signal_to_deliver(&info, &sigact, regs, NULL);  	if (signo > 0) { -		sigset_t *oldset; - -		if (test_thread_flag(TIF_RESTORE_SIGMASK)) -			oldset = ¤t->saved_sigmask; -		else -			oldset = ¤t->blocked; - -		if (handle_signal(signo, &info, &sigact, oldset, regs) == 0) { -			/* -			 * Successful delivery case.  The saved sigmask is -			 * stored in the signal frame, and will be restored -			 * by sigreturn.  We can clear the TIF flag. -			 */ -			clear_thread_flag(TIF_RESTORE_SIGMASK); - -			tracehook_signal_handler(signo, &info, &sigact, regs, -				test_thread_flag(TIF_SINGLESTEP)); -		} +		handle_signal(signo, &info, &sigact, regs);  		return;  	} -no_signal:  	/*  	 * If we came from a system call, handle the restart.  	 */ @@ -259,10 +231,7 @@ no_signal:  no_restart:  	/* If there's no signal to deliver, put the saved sigmask back */ -	if (test_thread_flag(TIF_RESTORE_SIGMASK)) { -		clear_thread_flag(TIF_RESTORE_SIGMASK); -		sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); -	} +	restore_saved_sigmask();  }  void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) @@ -272,8 +241,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)  	if (thread_info_flags & _TIF_NOTIFY_RESUME) {  		clear_thread_flag(TIF_NOTIFY_RESUME); -		if (current->replacement_session_keyring) -			key_replace_session_keyring(); +		tracehook_notify_resume(regs);  	}  } @@ -293,13 +261,15 @@ asmlinkage int sys_rt_sigreturn(void)  	struct rt_sigframe __user *frame;  	sigset_t blocked; +	/* Always make any pending restarted system calls return -EINTR */ +	current_thread_info()->restart_block.fn = do_no_restart_syscall; +  	frame = (struct rt_sigframe __user *)pt_psp(regs);  	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))  		goto badframe;  	if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked)))  		goto badframe; -	sigdelsetmask(&blocked, ~_BLOCKABLE);  	set_current_blocked(&blocked);  	if (restore_sigcontext(regs, &frame->uc.uc_mcontext))  |