aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/kernel/signal.c')
-rw-r--r--arch/tile/kernel/signal.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c
index 45835cfad407..45b66a3c991f 100644
--- a/arch/tile/kernel/signal.c
+++ b/arch/tile/kernel/signal.c
@@ -33,6 +33,7 @@
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/ucontext.h> 34#include <asm/ucontext.h>
35#include <asm/sigframe.h> 35#include <asm/sigframe.h>
36#include <asm/syscalls.h>
36#include <arch/interrupts.h> 37#include <arch/interrupts.h>
37 38
38#define DEBUG_SIG 0 39#define DEBUG_SIG 0
@@ -40,11 +41,8 @@
40#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 41#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
41 42
42 43
43/* Caller before callee in this file; other callee is in assembler */
44void do_signal(struct pt_regs *regs);
45
46long _sys_sigaltstack(const stack_t __user *uss, 44long _sys_sigaltstack(const stack_t __user *uss,
47 stack_t __user *uoss, struct pt_regs *regs) 45 stack_t __user *uoss, struct pt_regs *regs)
48{ 46{
49 return do_sigaltstack(uss, uoss, regs->sp); 47 return do_sigaltstack(uss, uoss, regs->sp);
50} 48}
@@ -65,7 +63,7 @@ int restore_sigcontext(struct pt_regs *regs,
65 63
66 for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) 64 for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
67 err |= __get_user(((long *)regs)[i], 65 err |= __get_user(((long *)regs)[i],
68 &((long *)(&sc->regs))[i]); 66 &((long __user *)(&sc->regs))[i]);
69 67
70 regs->faultnum = INT_SWINT_1_SIGRETURN; 68 regs->faultnum = INT_SWINT_1_SIGRETURN;
71 69
@@ -73,7 +71,8 @@ int restore_sigcontext(struct pt_regs *regs,
73 return err; 71 return err;
74} 72}
75 73
76int _sys_rt_sigreturn(struct pt_regs *regs) 74/* sigreturn() returns long since it restores r0 in the interrupted code. */
75long _sys_rt_sigreturn(struct pt_regs *regs)
77{ 76{
78 struct rt_sigframe __user *frame = 77 struct rt_sigframe __user *frame =
79 (struct rt_sigframe __user *)(regs->sp); 78 (struct rt_sigframe __user *)(regs->sp);
@@ -114,7 +113,7 @@ int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
114 113
115 for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) 114 for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
116 err |= __put_user(((long *)regs)[i], 115 err |= __put_user(((long *)regs)[i],
117 &((long *)(&sc->regs))[i]); 116 &((long __user *)(&sc->regs))[i]);
118 117
119 return err; 118 return err;
120} 119}
@@ -137,7 +136,7 @@ static inline void __user *get_sigframe(struct k_sigaction *ka,
137 * will die with SIGSEGV. 136 * will die with SIGSEGV.
138 */ 137 */
139 if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) 138 if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
140 return (void __user *) -1L; 139 return (void __user __force *)-1UL;
141 140
142 /* This is the X/Open sanctioned signal stack switching. */ 141 /* This is the X/Open sanctioned signal stack switching. */
143 if (ka->sa.sa_flags & SA_ONSTACK) { 142 if (ka->sa.sa_flags & SA_ONSTACK) {
@@ -185,8 +184,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
185 /* Create the ucontext. */ 184 /* Create the ucontext. */
186 err |= __clear_user(&frame->save_area, sizeof(frame->save_area)); 185 err |= __clear_user(&frame->save_area, sizeof(frame->save_area));
187 err |= __put_user(0, &frame->uc.uc_flags); 186 err |= __put_user(0, &frame->uc.uc_flags);
188 err |= __put_user(0, &frame->uc.uc_link); 187 err |= __put_user(NULL, &frame->uc.uc_link);
189 err |= __put_user((void *)(current->sas_ss_sp), 188 err |= __put_user((void __user *)(current->sas_ss_sp),
190 &frame->uc.uc_stack.ss_sp); 189 &frame->uc.uc_stack.ss_sp);
191 err |= __put_user(sas_ss_flags(regs->sp), 190 err |= __put_user(sas_ss_flags(regs->sp),
192 &frame->uc.uc_stack.ss_flags); 191 &frame->uc.uc_stack.ss_flags);