-From: Manuel Lauss <manuel.lauss@gmail.com>\r
-Subject: [RFC PATCH v4 2/2] MIPS: make FPU emulator optional\r
-Date: Mon, 7 Apr 2014 12:57:04 +0200\r
-Message-Id: <1396868224-252888-2-git-send-email-manuel.lauss@gmail.com>\r
-\r
-This small patch makes the MIPS FPU emulator optional. The kernel\r
-kills float-users on systems without a hardware FPU by sending a SIGILL.\r
-\r
-Disabling the emulator shrinks vmlinux by about 54kBytes (32bit,\r
-optimizing for size).\r
-\r
-Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>\r
----\r
-v4: rediffed because of patch 1/2, should now work with micromips as well\r
-v3: updated patch description with size savings.\r
-v2: incorporated changes suggested by Jonas Gorski\r
- force the fpu emulator on for micromips: relocating the parts\r
- of the mmips code in the emulator to other areas would be a\r
- much larger change; I went the cheap route instead with this.\r
-\r
- arch/mips/Kbuild | 2 +-\r
- arch/mips/Kconfig | 14 ++++++++++++++\r
- arch/mips/include/asm/fpu.h | 5 +++--\r
- arch/mips/include/asm/fpu_emulator.h | 15 +++++++++++++++\r
- 4 files changed, 33 insertions(+), 3 deletions(-)\r
-\r
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2521,6 +2521,20 @@ config MIPS_O32_FP64_SUPPORT
core-y += arch/mips/
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
-@@ -201,8 +201,10 @@ static inline int init_fpu(void)
- write_c0_config5(config5);
- enable_fpu_hazard();
- }
+@@ -210,8 +210,10 @@ static inline int init_fpu(void)
+ /* Restore FRE */
+ write_c0_config5(config5);
+ enable_fpu_hazard();
- } else
-+ } else if (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR))
++ } else (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR))
fpu_emulator_init_fpu();
+ else
+ ret = SIGILL;