aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu Takata <takata@linux-m32r.org>2006-02-24 16:03:51 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-24 17:31:36 -0500
commit6ced13cdcab440931b87829b0f2d0dedacfb3f2d (patch)
tree8bdd7a80685a7069b30a0e03d32892a81ea8ca9c
parentcde05cf2145b0aa06dd61277060bfba5d38acb0b (diff)
[PATCH] m32r: fix and update for gcc-4.0
Fix and update for gcc-4.0. - arch/m32r/kernel/signal.c: Change type of the 8th parameter of sys_rt_sigsuspend() from 'struct pt_regs' to 'struct pt_regs *'. This functions make use of the 'regs' parameter to return status value, but gcc-4.0 optimizes and removes it as a dead code. Functions, sys_sigaltstack() and sys_rt_sigreturn(), have also modified. - arch/m32r/lib/usercopy.c, include/asm-m32r/uaccess.h: Add early-clobber constraints('&') to output values of asm statements; these constraints seems to be required for gcc-4.0 register assignment. Signed-off-by: Hayato Fujiwara <fujiwara@linux-m32r.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-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 71763f7a1d19..cb33097fefc4 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 *);
36asmlinkage int 36asmlinkage int
37sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, 37sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
38 unsigned long r2, unsigned long r3, unsigned long r4, 38 unsigned long r2, unsigned long r3, unsigned long r4,
39 unsigned long r5, unsigned long r6, struct pt_regs regs) 39 unsigned long r5, unsigned long r6, struct pt_regs *regs)
40{ 40{
41 sigset_t saveset, newset; 41 sigset_t saveset, newset;
42 42
@@ -54,21 +54,21 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
54 recalc_sigpending(); 54 recalc_sigpending();
55 spin_unlock_irq(&current->sighand->siglock); 55 spin_unlock_irq(&current->sighand->siglock);
56 56
57 regs.r0 = -EINTR; 57 regs->r0 = -EINTR;
58 while (1) { 58 while (1) {
59 current->state = TASK_INTERRUPTIBLE; 59 current->state = TASK_INTERRUPTIBLE;
60 schedule(); 60 schedule();
61 if (do_signal(&regs, &saveset)) 61 if (do_signal(regs, &saveset))
62 return regs.r0; 62 return regs->r0;
63 } 63 }
64} 64}
65 65
66asmlinkage int 66asmlinkage int
67sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 67sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
68 unsigned long r2, unsigned long r3, unsigned long r4, 68 unsigned long r2, unsigned long r3, unsigned long r4,
69 unsigned long r5, unsigned long r6, struct pt_regs regs) 69 unsigned long r5, unsigned long r6, struct pt_regs *regs)
70{ 70{
71 return do_sigaltstack(uss, uoss, regs.spu); 71 return do_sigaltstack(uss, uoss, regs->spu);
72} 72}
73 73
74 74
@@ -140,11 +140,10 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
140asmlinkage int 140asmlinkage int
141sys_rt_sigreturn(unsigned long r0, unsigned long r1, 141sys_rt_sigreturn(unsigned long r0, unsigned long r1,
142 unsigned long r2, unsigned long r3, unsigned long r4, 142 unsigned long r2, unsigned long r3, unsigned long r4,
143 unsigned long r5, unsigned long r6, struct pt_regs regs) 143 unsigned long r5, unsigned long r6, struct pt_regs *regs)
144{ 144{
145 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.spu; 145 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->spu;
146 sigset_t set; 146 sigset_t set;
147 stack_t st;
148 int result; 147 int result;
149 148
150 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 149 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -158,14 +157,11 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
158 recalc_sigpending(); 157 recalc_sigpending();
159 spin_unlock_irq(&current->sighand->siglock); 158 spin_unlock_irq(&current->sighand->siglock);
160 159
161 if (restore_sigcontext(&regs, &frame->uc.uc_mcontext, &result)) 160 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
162 goto badframe; 161 goto badframe;
163 162
164 if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) 163 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT)
165 goto badframe; 164 goto badframe;
166 /* It is more difficult to avoid calling this function than to
167 call it and ignore errors. */
168 do_sigaltstack(&st, NULL, regs.spu);
169 165
170 return result; 166 return result;
171 167
diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c
index ce16bbe26a52..2d1dd2106c4d 100644
--- a/arch/m32r/lib/usercopy.c
+++ b/arch/m32r/lib/usercopy.c
@@ -64,7 +64,7 @@ do { \
64 " .balign 4\n" \ 64 " .balign 4\n" \
65 " .long 0b,3b\n" \ 65 " .long 0b,3b\n" \
66 ".previous" \ 66 ".previous" \
67 : "=r"(res), "=r"(count), "=&r" (__d0), "=&r" (__d1), \ 67 : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \
68 "=&r" (__d2) \ 68 "=&r" (__d2) \
69 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \ 69 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \
70 "4"(dst) \ 70 "4"(dst) \
@@ -101,7 +101,7 @@ do { \
101 " .balign 4\n" \ 101 " .balign 4\n" \
102 " .long 0b,3b\n" \ 102 " .long 0b,3b\n" \
103 ".previous" \ 103 ".previous" \
104 : "=r"(res), "=r"(count), "=&r" (__d0), "=&r" (__d1), \ 104 : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \
105 "=&r" (__d2) \ 105 "=&r" (__d2) \
106 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \ 106 : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \
107 "4"(dst) \ 107 "4"(dst) \
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index 0da7c47d2f01..e8ae61956a51 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -328,7 +328,7 @@ extern void __put_user_bad(void);
328 " .long 1b,4b\n" \ 328 " .long 1b,4b\n" \
329 " .long 2b,4b\n" \ 329 " .long 2b,4b\n" \
330 ".previous" \ 330 ".previous" \
331 : "=r"(err) \ 331 : "=&r"(err) \
332 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ 332 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
333 : "r14", "memory") 333 : "r14", "memory")
334 334
@@ -353,7 +353,7 @@ extern void __put_user_bad(void);
353 " .long 1b,4b\n" \ 353 " .long 1b,4b\n" \
354 " .long 2b,4b\n" \ 354 " .long 2b,4b\n" \
355 ".previous" \ 355 ".previous" \
356 : "=r"(err) \ 356 : "=&r"(err) \
357 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ 357 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
358 : "r14", "memory") 358 : "r14", "memory")
359#else 359#else
@@ -398,7 +398,7 @@ struct __large_struct { unsigned long buf[100]; };
398 " .balign 4\n" \ 398 " .balign 4\n" \
399 " .long 1b,3b\n" \ 399 " .long 1b,3b\n" \
400 ".previous" \ 400 ".previous" \
401 : "=r"(err) \ 401 : "=&r"(err) \
402 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ 402 : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \
403 : "r14", "memory") 403 : "r14", "memory")
404 404
@@ -442,7 +442,7 @@ do { \
442 " .balign 4\n" \ 442 " .balign 4\n" \
443 " .long 1b,3b\n" \ 443 " .long 1b,3b\n" \
444 ".previous" \ 444 ".previous" \
445 : "=r"(err), "=&r"(x) \ 445 : "=&r"(err), "=&r"(x) \
446 : "r"(addr), "i"(-EFAULT), "0"(err) \ 446 : "r"(addr), "i"(-EFAULT), "0"(err) \
447 : "r14", "memory") 447 : "r14", "memory")
448 448