aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/powerpc/fpu.c
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2013-11-17 14:44:22 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2013-11-17 14:44:22 +0000
commitdebe44551207018d9b9e123536693e74acfd0bbd (patch)
treefaec530c93bef836627d6a6f15ff9981b38e2dbf /sys/powerpc/powerpc/fpu.c
parent309c874c28b28bc44937a9410bfbbe2a7af7a468 (diff)
downloadsrc-debe44551207018d9b9e123536693e74acfd0bbd.tar.gz
src-debe44551207018d9b9e123536693e74acfd0bbd.zip
Split the function of the PCB_FPU flags into two: PCB_FPU now indicates that
the actual FPU is enabled, while PCB_FPREGS indicates that the FPU state structure in the PCB is valid. This separation reflects the situation on FPU-less systems in which the FP state is used by the emulator but we don't actually want to try to turn on the non-existant FPU. Use this flag to save and restore FP regs properly on both AIM and Book-E. As a side effect, this sets up hard-FP and Altivec on Book-E CPUs with such abilities except for a trap handler to call enable_fpu()/enable_altivec().
Notes
Notes: svn path=/head/; revision=258257
Diffstat (limited to 'sys/powerpc/powerpc/fpu.c')
-rw-r--r--sys/powerpc/powerpc/fpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/powerpc/powerpc/fpu.c b/sys/powerpc/powerpc/fpu.c
index c4cc326da431..b719218b704f 100644
--- a/sys/powerpc/powerpc/fpu.c
+++ b/sys/powerpc/powerpc/fpu.c
@@ -66,10 +66,11 @@ enable_fpu(struct thread *td)
* initialise the FPU registers and FPSCR to 0, and set the flag
* to indicate that the FPU is in use.
*/
+ pcb->pcb_flags |= PCB_FPU;
tf->srr1 |= PSL_FP;
- if (!(pcb->pcb_flags & PCB_FPU)) {
+ if (!(pcb->pcb_flags & PCB_FPREGS)) {
memset(&pcb->pcb_fpu, 0, sizeof pcb->pcb_fpu);
- pcb->pcb_flags |= PCB_FPU;
+ pcb->pcb_flags |= PCB_FPREGS;
}
/*