Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b616365e authored by Huacai Chen's avatar Huacai Chen Committed by Ralf Baechle
Browse files

MIPS: FPU: Fix conflict of register usage



In _restore_fp_context/_restore_fp_context32, t0 is used for both
CP0_Status and CP1_FCSR. This is a mistake and cause FP exeception on
boot, so fix it.

Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Tested-by: default avatarAndreas Barth <aba@ayous.org>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/6507/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f5868f05
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ LEAF(_save_fp_context32)
 *  - cp1 status/control register
 */
LEAF(_restore_fp_context)
	EX	lw t0, SC_FPC_CSR(a0)
	EX	lw t1, SC_FPC_CSR(a0)

#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
	.set	push
@@ -191,7 +191,7 @@ LEAF(_restore_fp_context)
	EX	ldc1 $f26, SC_FPREGS+208(a0)
	EX	ldc1 $f28, SC_FPREGS+224(a0)
	EX	ldc1 $f30, SC_FPREGS+240(a0)
	ctc1	t0, fcr31
	ctc1	t1, fcr31
	jr	ra
	 li	v0, 0					# success
	END(_restore_fp_context)
@@ -199,7 +199,7 @@ LEAF(_restore_fp_context)
#ifdef CONFIG_MIPS32_COMPAT
LEAF(_restore_fp_context32)
	/* Restore an o32 sigcontext.  */
	EX	lw t0, SC32_FPC_CSR(a0)
	EX	lw t1, SC32_FPC_CSR(a0)

	mfc0	t0, CP0_STATUS
	sll	t0, t0, 5
@@ -239,7 +239,7 @@ LEAF(_restore_fp_context32)
	EX	ldc1 $f26, SC32_FPREGS+208(a0)
	EX	ldc1 $f28, SC32_FPREGS+224(a0)
	EX	ldc1 $f30, SC32_FPREGS+240(a0)
	ctc1	t0, fcr31
	ctc1	t1, fcr31
	jr	ra
	 li	v0, 0					# success
	END(_restore_fp_context32)