diff options
Diffstat (limited to 'arch/mips/math-emu/kernel_linkage.c')
-rw-r--r-- | arch/mips/math-emu/kernel_linkage.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c index 3aeae07ed5b..9b46213b103 100644 --- a/arch/mips/math-emu/kernel_linkage.c +++ b/arch/mips/math-emu/kernel_linkage.c @@ -40,9 +40,8 @@ void fpu_emulator_init_fpu(void) } current->thread.fpu.fcr31 = 0; - for (i = 0; i < 32; i++) { - current->thread.fpu.fpr[i] = SIGNALLING_NAN; - } + for (i = 0; i < 32; i++) + set_fpr64(¤t->thread.fpu.fpr[i], 0, SIGNALLING_NAN); } @@ -59,7 +58,8 @@ int fpu_emulator_save_context(struct sigcontext __user *sc) for (i = 0; i < 32; i++) { err |= - __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); + __put_user(get_fpr64(¤t->thread.fpu.fpr[i], 0), + &sc->sc_fpregs[i]); } err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); @@ -70,10 +70,11 @@ int fpu_emulator_restore_context(struct sigcontext __user *sc) { int i; int err = 0; + u64 fpr_val; for (i = 0; i < 32; i++) { - err |= - __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); + err |= __get_user(fpr_val, &sc->sc_fpregs[i]); + set_fpr64(¤t->thread.fpu.fpr[i], 0, fpr_val); } err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); @@ -93,7 +94,8 @@ int fpu_emulator_save_context32(struct sigcontext32 __user *sc) for (i = 0; i < 32; i += inc) { err |= - __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); + __put_user(get_fpr64(¤t->thread.fpu.fpr[i], 0), + &sc->sc_fpregs[i]); } err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); @@ -105,10 +107,11 @@ int fpu_emulator_restore_context32(struct sigcontext32 __user *sc) int i; int err = 0; int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1; + u64 fpr_val; for (i = 0; i < 32; i += inc) { - err |= - __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]); + err |= __get_user(fpr_val, &sc->sc_fpregs[i]); + set_fpr64(¤t->thread.fpu.fpr[i], 0, fpr_val); } err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr); |