summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/m32r/kernel/signal.c24
-rw-r--r--arch/m32r/lib/usercopy.c4
-rw-r--r--include/asm-m32r/uaccess.h8
3 files changed, 16 insertions, 20 deletions
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 71763f7a1d1..cb33097fefc 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -36,7 +36,7 @@ int do_signal(struct pt_regs *, sigset_t *);
asmlinkage int
sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
unsigned long r2, unsigned long r3, unsigned long r4,
- unsigned long r5, unsigned long r6, struct pt_regs regs)
+ unsigned long r5, unsigned long r6, struct pt_regs *regs)
{
sigset_t saveset, newset;
@@ -54,21 +54,21 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
- regs.r0 = -EINTR;
+ regs->r0 = -EINTR;
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
- if (do_signal(&regs, &saveset))
- return regs.r0;
+ if (do_signal(regs, &saveset))
+ return regs->r0;
}
}
asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r2, unsigned long r3, unsigned long r4,
- unsigned long r5, unsigned long r6, struct pt_regs regs)
+ unsigned long r5, unsigned long r6, struct pt_regs *regs)
{
- return do_sigaltstack(uss, uoss, regs.spu);
+ return do_sigaltstack(uss, uoss, regs->spu);
}
@@ -140,11 +140,10 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
asmlinkage int
sys_rt_sigreturn(unsigned long r0, unsigned long r1,
unsigned long r2, unsigned long r3, unsigned long r4,
- unsigned long r5, unsigned long r6, struct pt_regs regs)
+ unsigned long r5, unsigned long r6, struct pt_regs *regs)
{
- struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.spu;
+ struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->spu;
sigset_t set;
- stack_t st;
int result;
if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -158,14 +157,11 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
- if (restore_sigcontext(&regs, &frame->uc.uc_mcontext, &result))
+ if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
goto badframe;
- if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT)
goto badframe;
- /* It is more difficult to avoid calling this function than to
- call it and ignore errors. */
- do_sigaltstack(&st, NULL, regs.spu);
return result;
diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c
index ce16bbe26a5..2d1dd2106c4 100644
--- a/arch/m32r/lib/usercopy.c
+++ b/arch/m32r/lib/usercopy.c
@@ -64,7 +64,7 @@ do { \
" .balign 4\n" \
" .long 0b,3b\n" \
".previous" \
- : "=r"(res), "=r"(count), "=&r" (__d0), "=&r" (__d1), \
+ : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \
"=&r" (__d2) \
: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \
"4"(dst) \
@@ -101,7 +101,7 @@ do { \
" .balign 4\n" \
" .long 0b,3b\n" \
".previous" \
- : "=r"(res), "=r"(count), "=&r" (__d0), "=&r" (__d1), \
+ : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \
"=&r" (__d2) \
: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \
"4"(dst) \
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index 0da7c47d2f0..e8ae61956a5 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -328,7 +328,7 @@ extern void __put_user_bad(void);
" .long 1b,4b\n" \
" .long 2b,4b\n" \
".previous" \
- : "=r"(err) \
+ : "=&r"(err) \
: "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
: "r14", "memory")
@@ -353,7 +353,7 @@ extern void __put_user_bad(void);
" .long 1b,4b\n" \
" .long 2b,4b\n" \
".previous" \
- : "=r"(err) \
+ : "=&r"(err) \
: "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
: "r14", "memory")
#else
@@ -398,7 +398,7 @@ struct __large_struct { unsigned long buf[100]; };
" .balign 4\n" \
" .long 1b,3b\n" \
".previous" \
- : "=r"(err) \
+ : "=&r"(err) \
: "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
: "r14", "memory")
@@ -442,7 +442,7 @@ do { \
" .balign 4\n" \
" .long 1b,3b\n" \
".previous" \
- : "=r"(err), "=&r"(x) \
+ : "=&r"(err), "=&r"(x) \
: "r"(addr), "i"(-EFAULT), "0"(err) \
: "r14", "memory")