]> err.no Git - linux-2.6/blobdiff - arch/ppc/kernel/traps.c
[PATCH] powerpc: Fix handling of fpscr on 64-bit
[linux-2.6] / arch / ppc / kernel / traps.c
index 26606aa33de6e292a0689e19ab0c8694ede75c8c..f265b81e7008b7cdc97cd20ad4ca6c032bd3df52 100644 (file)
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include <asm/backlight.h>
 #endif
-#include <asm/perfmon.h>
+#include <asm/pmc.h>
 
 #ifdef CONFIG_XMON
+extern int xmon_bpt(struct pt_regs *regs);
+extern int xmon_sstep(struct pt_regs *regs);
+extern int xmon_iabr_match(struct pt_regs *regs);
+extern int xmon_dabr_match(struct pt_regs *regs);
+
 void (*debugger)(struct pt_regs *regs) = xmon;
 int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
 int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
@@ -654,7 +659,7 @@ void program_check_exception(struct pt_regs *regs)
                        giveup_fpu(current);
                preempt_enable();
 
-               fpscr = current->thread.fpscr;
+               fpscr = current->thread.fpscr.val;
                fpscr &= fpscr << 22;   /* mask summary bits with enables */
                if (fpscr & FPSCR_VX)
                        code = FPE_FLTINV;
@@ -814,6 +819,17 @@ void TAUException(struct pt_regs *regs)
 }
 #endif /* CONFIG_INT_TAU */
 
+/*
+ * FP unavailable trap from kernel - print a message, but let
+ * the task use FP in the kernel until it returns to user mode.
+ */
+void kernel_fp_unavailable_exception(struct pt_regs *regs)
+{
+       regs->msr |= MSR_FP;
+       printk(KERN_ERR "floating point used in kernel (task=%p, pc=%lx)\n",
+              current, regs->nip);
+}
+
 void altivec_unavailable_exception(struct pt_regs *regs)
 {
        static int kernel_altivec_count;