Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Don't compile math-emu when CONFIG_MIPS_FP_SUPPORT=n

When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point, so
there's no point compiling in our FPU emulator. Avoid doing so,
providing stub versions of dsemul cleanup functions that are called from
signal & task handling code.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21012/
Cc: linux-mips@linux-mips.org

+29 -2
+1 -1
arch/mips/Makefile
··· 319 319 head-y := arch/mips/kernel/head.o 320 320 321 321 libs-y += arch/mips/lib/ 322 - libs-y += arch/mips/math-emu/ 322 + libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/ 323 323 324 324 # See arch/mips/Kbuild for content of core part of the kernel 325 325 core-y += arch/mips/
+28 -1
arch/mips/include/asm/dsemul.h
··· 52 52 * 53 53 * Return: True if an emulation frame was returned from, else false. 54 54 */ 55 + #ifdef CONFIG_MIPS_FP_SUPPORT 55 56 extern bool do_dsemulret(struct pt_regs *xcp); 57 + #else 58 + static inline bool do_dsemulret(struct pt_regs *xcp) 59 + { 60 + return false; 61 + } 62 + #endif 56 63 57 64 /** 58 65 * dsemul_thread_cleanup() - Cleanup thread 'emulation' frame ··· 70 63 * 71 64 * Return: True if a frame was freed, else false. 72 65 */ 66 + #ifdef CONFIG_MIPS_FP_SUPPORT 73 67 extern bool dsemul_thread_cleanup(struct task_struct *tsk); 74 - 68 + #else 69 + static inline bool dsemul_thread_cleanup(struct task_struct *tsk) 70 + { 71 + return false; 72 + } 73 + #endif 75 74 /** 76 75 * dsemul_thread_rollback() - Rollback from an 'emulation' frame 77 76 * @regs: User thread register context. ··· 90 77 * 91 78 * Return: True if a frame was exited, else false. 92 79 */ 80 + #ifdef CONFIG_MIPS_FP_SUPPORT 93 81 extern bool dsemul_thread_rollback(struct pt_regs *regs); 82 + #else 83 + static inline bool dsemul_thread_rollback(struct pt_regs *regs) 84 + { 85 + return false; 86 + } 87 + #endif 94 88 95 89 /** 96 90 * dsemul_mm_cleanup() - Cleanup per-mm delay slot 'emulation' state ··· 107 87 * for delay slot 'emulation' book-keeping is freed. This is to be called 108 88 * before @mm is freed in order to avoid memory leaks. 109 89 */ 90 + #ifdef CONFIG_MIPS_FP_SUPPORT 110 91 extern void dsemul_mm_cleanup(struct mm_struct *mm); 92 + #else 93 + static inline void dsemul_mm_cleanup(struct mm_struct *mm) 94 + { 95 + /* no-op */ 96 + } 97 + #endif 111 98 112 99 #endif /* __MIPS_ASM_DSEMUL_H__ */