diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-12-24 20:53:58 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-12-24 20:53:58 +0100 |
commit | 77e0feb67c2a5cf37d23810504a28fdc3c7ad380 (patch) | |
tree | 6f9ab61c3bbc1cecde0814f882afb112ccc22910 /sys/src | |
parent | 1c6daca577a0c017ff882cf57ddd09afe543e65f (diff) |
zynq: fpsave() and fpclear() both need to disable the fpu
fpsave needs to disable the fpu! otherwise we won't catch
the mathtrap() in the kernel or when context switching to
another process that will attempt to use it.
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/zynq/l.s | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sys/src/9/zynq/l.s b/sys/src/9/zynq/l.s index a02ac6c7c..ee8f308a2 100644 --- a/sys/src/9/zynq/l.s +++ b/sys/src/9/zynq/l.s @@ -307,14 +307,6 @@ TEXT fpinit(SB), $0 VMSR(0xe, 0, FPSCR) RET -TEXT fpsave(SB), $0 - VMRS(0xe, FPEXC, 1) - VMRS(0xe, FPSCR, 2) - MOVM.IA.W [R1-R2], (R0) - WORD $0xeca00b20 - WORD $0xece00b20 - RET - TEXT fprestore(SB), $0 MOVM.IA.W (R0), [R1-R2] VMSR(0xe, 1, FPEXC) @@ -323,14 +315,17 @@ TEXT fprestore(SB), $0 WORD $0xecf00b20 RET -TEXT fpoff(SB), $0 - MOVW $0, R1 - VMSR(0xe, 1, FPEXC) - RET +TEXT fpsave(SB), $0 + VMRS(0xe, FPEXC, 1) + VMRS(0xe, FPSCR, 2) + MOVM.IA.W [R1-R2], (R0) + WORD $0xeca00b20 + WORD $0xece00b20 + /* wet floor */ +TEXT fpoff(SB), $0 TEXT fpclear(SB), $0 - VMRS(0xe, FPEXC, 1) - AND $(3<<30), R1 + MOVW $0, R1 VMSR(0xe, 1, FPEXC) RET |