aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2006-11-20 21:16:57 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-05 20:45:38 -0500
commitf0bc814cfbc212683c882e58b3d1afec6b3e3aa3 (patch)
tree8ad669003716a3c22fb43e9c2066dcc5e5e0ad2d /arch/sh/kernel/cpu/sh4
parent53644087a607040a56d883df612b588814a56f11 (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/cpu/sh4')
-rw-r--r--arch/sh/kernel/cpu/sh4/fpu.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index f486c07e10e2..378b488237c9 100644
--- a/arch/sh/kernel/cpu/sh4/fpu.c
+++ b/arch/sh/kernel/cpu/sh4/fpu.c
@@ -296,16 +296,17 @@ ieee_fpe_handler (struct pt_regs *regs)
296} 296}
297 297
298asmlinkage void 298asmlinkage void
299do_fpu_error(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, 299do_fpu_error(unsigned long r4, unsigned long r5, unsigned long r6,
300 struct pt_regs regs) 300 unsigned long r7, struct pt_regs __regs)
301{ 301{
302 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
302 struct task_struct *tsk = current; 303 struct task_struct *tsk = current;
303 304
304 if (ieee_fpe_handler (&regs)) 305 if (ieee_fpe_handler(regs))
305 return; 306 return;
306 307
307 regs.pc += 2; 308 regs->pc += 2;
308 save_fpu(tsk, &regs); 309 save_fpu(tsk, regs);
309 tsk->thread.trap_no = 11; 310 tsk->thread.trap_no = 11;
310 tsk->thread.error_code = 0; 311 tsk->thread.error_code = 0;
311 force_sig(SIGFPE, tsk); 312 force_sig(SIGFPE, tsk);
@@ -313,12 +314,13 @@ do_fpu_error(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long
313 314
314asmlinkage void 315asmlinkage void
315do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6, 316do_fpu_state_restore(unsigned long r4, unsigned long r5, unsigned long r6,
316 unsigned long r7, struct pt_regs regs) 317 unsigned long r7, struct pt_regs __regs)
317{ 318{
319 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
318 struct task_struct *tsk = current; 320 struct task_struct *tsk = current;
319 321
320 grab_fpu(&regs); 322 grab_fpu(regs);
321 if (!user_mode(&regs)) { 323 if (!user_mode(regs)) {
322 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n"); 324 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
323 return; 325 return;
324 } 326 }