diff options
author | Stuart Menefy <stuart.menefy@st.com> | 2006-11-20 21:16:57 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-05 20:45:38 -0500 |
commit | f0bc814cfbc212683c882e58b3d1afec6b3e3aa3 (patch) | |
tree | 8ad669003716a3c22fb43e9c2066dcc5e5e0ad2d /arch/sh/kernel/signal.c | |
parent | 53644087a607040a56d883df612b588814a56f11 (diff) |
sh: gcc4 support.
This fixes up the kernel for gcc4. The existing exception handlers
needed some wrapping for pt_regs access, acessing the registers
via a RELOC_HIDE() pointer.
The strcpy() issues popped up here too, so add -ffreestanding and
kill off the symbol export.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/signal.c')
-rw-r--r-- | arch/sh/kernel/signal.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 764886b4bcf1..50d7c4993bef 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c | |||
@@ -37,7 +37,7 @@ | |||
37 | asmlinkage int | 37 | asmlinkage int |
38 | sys_sigsuspend(old_sigset_t mask, | 38 | sys_sigsuspend(old_sigset_t mask, |
39 | unsigned long r5, unsigned long r6, unsigned long r7, | 39 | unsigned long r5, unsigned long r6, unsigned long r7, |
40 | struct pt_regs regs) | 40 | struct pt_regs __regs) |
41 | { | 41 | { |
42 | mask &= _BLOCKABLE; | 42 | mask &= _BLOCKABLE; |
43 | spin_lock_irq(¤t->sighand->siglock); | 43 | spin_lock_irq(¤t->sighand->siglock); |
@@ -52,7 +52,7 @@ sys_sigsuspend(old_sigset_t mask, | |||
52 | return -ERESTARTNOHAND; | 52 | return -ERESTARTNOHAND; |
53 | } | 53 | } |
54 | 54 | ||
55 | asmlinkage int | 55 | asmlinkage int |
56 | sys_sigaction(int sig, const struct old_sigaction __user *act, | 56 | sys_sigaction(int sig, const struct old_sigaction __user *act, |
57 | struct old_sigaction __user *oact) | 57 | struct old_sigaction __user *oact) |
58 | { | 58 | { |
@@ -87,9 +87,11 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
87 | asmlinkage int | 87 | asmlinkage int |
88 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 88 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
89 | unsigned long r6, unsigned long r7, | 89 | unsigned long r6, unsigned long r7, |
90 | struct pt_regs regs) | 90 | struct pt_regs __regs) |
91 | { | 91 | { |
92 | return do_sigaltstack(uss, uoss, regs.regs[15]); | 92 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); |
93 | |||
94 | return do_sigaltstack(uss, uoss, regs->regs[15]); | ||
93 | } | 95 | } |
94 | 96 | ||
95 | 97 | ||
@@ -198,9 +200,10 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p | |||
198 | 200 | ||
199 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | 201 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, |
200 | unsigned long r6, unsigned long r7, | 202 | unsigned long r6, unsigned long r7, |
201 | struct pt_regs regs) | 203 | struct pt_regs __regs) |
202 | { | 204 | { |
203 | struct sigframe __user *frame = (struct sigframe __user *)regs.regs[15]; | 205 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); |
206 | struct sigframe __user *frame = (struct sigframe __user *)regs->regs[15]; | ||
204 | sigset_t set; | 207 | sigset_t set; |
205 | int r0; | 208 | int r0; |
206 | 209 | ||
@@ -220,7 +223,7 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | |||
220 | recalc_sigpending(); | 223 | recalc_sigpending(); |
221 | spin_unlock_irq(¤t->sighand->siglock); | 224 | spin_unlock_irq(¤t->sighand->siglock); |
222 | 225 | ||
223 | if (restore_sigcontext(®s, &frame->sc, &r0)) | 226 | if (restore_sigcontext(regs, &frame->sc, &r0)) |
224 | goto badframe; | 227 | goto badframe; |
225 | return r0; | 228 | return r0; |
226 | 229 | ||
@@ -231,9 +234,10 @@ badframe: | |||
231 | 234 | ||
232 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | 235 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, |
233 | unsigned long r6, unsigned long r7, | 236 | unsigned long r6, unsigned long r7, |
234 | struct pt_regs regs) | 237 | struct pt_regs __regs) |
235 | { | 238 | { |
236 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.regs[15]; | 239 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); |
240 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15]; | ||
237 | sigset_t set; | 241 | sigset_t set; |
238 | stack_t st; | 242 | stack_t st; |
239 | int r0; | 243 | int r0; |
@@ -250,14 +254,14 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
250 | recalc_sigpending(); | 254 | recalc_sigpending(); |
251 | spin_unlock_irq(¤t->sighand->siglock); | 255 | spin_unlock_irq(¤t->sighand->siglock); |
252 | 256 | ||
253 | if (restore_sigcontext(®s, &frame->uc.uc_mcontext, &r0)) | 257 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
254 | goto badframe; | 258 | goto badframe; |
255 | 259 | ||
256 | if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) | 260 | if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) |
257 | goto badframe; | 261 | goto badframe; |
258 | /* It is more difficult to avoid calling this function than to | 262 | /* It is more difficult to avoid calling this function than to |
259 | call it and ignore errors. */ | 263 | call it and ignore errors. */ |
260 | do_sigaltstack(&st, NULL, regs.regs[15]); | 264 | do_sigaltstack(&st, NULL, regs->regs[15]); |
261 | 265 | ||
262 | return r0; | 266 | return r0; |
263 | 267 | ||