void
enable_kernel_altivec(void)
{
+ preempt_disable();
#ifdef CONFIG_SMP
if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
giveup_altivec(current);
#else
giveup_altivec(last_task_used_altivec);
#endif /* __SMP __ */
+ preempt_enable();
}
#endif /* CONFIG_ALTIVEC */
void
enable_kernel_fp(void)
{
+ preempt_disable();
#ifdef CONFIG_SMP
if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
giveup_fpu(current);
#else
giveup_fpu(last_task_used_math);
#endif /* CONFIG_SMP */
+ preempt_enable();
}
int
dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
{
- if (tsk->thread.regs && tsk->thread.regs->msr & MSR_FP)
+ preempt_disable();
+ if (tsk->thread.regs && (tsk->thread.regs->msr & MSR_FP))
giveup_fpu(tsk);
+ preempt_enable();
memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs));
return 1;
}
if (regs == NULL)
return;
+ preempt_disable();
if (regs->msr & MSR_FP)
giveup_fpu(current);
#ifdef CONFIG_ALTIVEC
if (regs->msr & MSR_VEC)
giveup_altivec(current);
#endif /* CONFIG_ALTIVEC */
+ preempt_enable();
}
/*
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
+ preempt_disable();
if (regs->msr & MSR_FP)
giveup_fpu(current);
#ifdef CONFIG_ALTIVEC
if (regs->msr & MSR_VEC)
giveup_altivec(current);
#endif /* CONFIG_ALTIVEC */
+ preempt_enable();
error = do_execve(filename, (char __user *__user *) a1,
(char __user *__user *) a2, regs);
if (error == 0)
return 0;
if (bug->line & BUG_WARNING_TRAP) {
/* this is a WARN_ON rather than BUG/BUG_ON */
+#ifdef CONFIG_XMON
+ xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
+ bug->function, bug->file,
+ bug->line & ~BUG_WARNING_TRAP);
+#endif /* CONFIG_XMON */
printk(KERN_ERR "Badness in %s at %s:%d\n",
bug->function, bug->file,
bug->line & ~BUG_WARNING_TRAP);
dump_stack();
return 1;
}
+#ifdef CONFIG_XMON
+ xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
+ bug->function, bug->file, bug->line);
+ xmon(regs);
+#endif /* CONFIG_XMON */
printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
bug->function, bug->file, bug->line);
+
return 0;
}
int code = 0;
u32 fpscr;
+ /* We must make sure the FP state is consistent with
+ * our MSR_FP in regs
+ */
+ preempt_disable();
if (regs->msr & MSR_FP)
giveup_fpu(current);
+ preempt_enable();
+
fpscr = current->thread.fpscr;
fpscr &= fpscr << 22; /* mask summary bits with enables */
if (fpscr & FPSCR_VX)
void
AltivecAssistException(struct pt_regs *regs)
{
+ preempt_disable();
if (regs->msr & MSR_VEC)
giveup_altivec(current);
+ preempt_enable();
+
/* XXX quick hack for now: set the non-Java bit in the VSCR */
current->thread.vscr.u[3] |= 0x10000;
}
#endif /* CONFIG_ALTIVEC */
+
void __init trap_init(void)
{
}