Skip to content

Commit

Permalink
MIPS: FRE: Use set/clear_c0_config5 instead of open coded sequences.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Jan 13, 2015
1 parent b0c34f6 commit d33e6fe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/mips/include/asm/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
return SIGFPE;

/* set FRE */
write_c0_config5(read_c0_config5() | MIPS_CONF5_FRE);
set_c0_config5(MIPS_CONF5_FRE);
goto fr_common;

case FPU_64BIT:
Expand All @@ -76,7 +76,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
case FPU_32BIT:
if (cpu_has_fre) {
/* clear FRE */
write_c0_config5(read_c0_config5() & ~MIPS_CONF5_FRE);
clear_c0_config5(MIPS_CONF5_FRE);
}
fr_common:
/* set CU1 & change FR appropriately */
Expand Down Expand Up @@ -196,15 +196,13 @@ static inline int init_fpu(void)
return 0;
}

config5 = read_c0_config5();

/*
* Ensure FRE is clear whilst running _init_fpu, since
* single precision FP instructions are used. If FRE
* was set then we'll just end up initialising all 32
* 64b registers.
*/
write_c0_config5(config5 & ~MIPS_CONF5_FRE);
config5 = clear_c0_config5(MIPS_CONF5_FRE);
enable_fpu_hazard();

_init_fpu();
Expand Down

0 comments on commit d33e6fe

Please sign in to comment.