diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-05-10 20:38:03 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-05-10 20:38:03 +0000 |
commit | b12f9adf74925546b6e9c64de4d2b7412e9d2e83 (patch) | |
tree | ab36129e75624c475a449df3834b0f7d320f1e89 /arch/mips64 | |
parent | fe16db766c5074082d404abb4eacdc76af118640 (diff) |
UP FPU state handling fixes: make sure to save the fpu state of the
last fpu owner before we assign the fpu to a new math task. However
is mips/mips64 working with this bug? Fix needs to be ported to
2.2/2.3 mips code. Additionally, the mips64 lazy_fpu_switch code
seems to have a ".set reorder" at the wrong place.
Diffstat (limited to 'arch/mips64')
-rw-r--r-- | arch/mips64/kernel/r4k_switch.S | 3 | ||||
-rw-r--r-- | arch/mips64/kernel/traps.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/mips64/kernel/r4k_switch.S b/arch/mips64/kernel/r4k_switch.S index 8ad1c5eb0..f82ea64a4 100644 --- a/arch/mips64/kernel/r4k_switch.S +++ b/arch/mips64/kernel/r4k_switch.S @@ -91,6 +91,8 @@ LEAF(lazy_fpu_switch) fpu_save_16even a0 t1 # clobbers t1 2: + beqz a1, 3f + sll t0, t0, 5 # load new fp state bgez t0, 1f ldc1 $f0, (THREAD_FPU + 0x00)($28) @@ -98,6 +100,7 @@ LEAF(lazy_fpu_switch) 1: .set reorder fpu_restore_16even $28, t0 # clobbers t0 +3: jr ra END(lazy_fpu_switch) diff --git a/arch/mips64/kernel/traps.c b/arch/mips64/kernel/traps.c index 88a17ecc8..9f97fb0d8 100644 --- a/arch/mips64/kernel/traps.c +++ b/arch/mips64/kernel/traps.c @@ -350,8 +350,9 @@ void do_cpu(struct pt_regs *regs) return; if (current->used_math) { /* Using the FPU again. */ - lazy_fpu_switch(last_task_used_math); + lazy_fpu_switch(last_task_used_math, current); } else { /* First time FPU user. */ + lazy_fpu_switch(last_task_used_math, 0); init_fpu(); current->used_math = 1; } |