Commit 42b10815 authored by Paul Burton's avatar Paul Burton

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: default avatarPaul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21012/
Cc: linux-mips@linux-mips.org
parent 36a49803
...@@ -319,7 +319,7 @@ OBJCOPYFLAGS += --remove-section=.reginfo ...@@ -319,7 +319,7 @@ OBJCOPYFLAGS += --remove-section=.reginfo
head-y := arch/mips/kernel/head.o head-y := arch/mips/kernel/head.o
libs-y += arch/mips/lib/ libs-y += arch/mips/lib/
libs-y += arch/mips/math-emu/ libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/
# See arch/mips/Kbuild for content of core part of the kernel # See arch/mips/Kbuild for content of core part of the kernel
core-y += arch/mips/ core-y += arch/mips/
......
...@@ -52,7 +52,14 @@ extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir, ...@@ -52,7 +52,14 @@ extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
* *
* Return: True if an emulation frame was returned from, else false. * Return: True if an emulation frame was returned from, else false.
*/ */
#ifdef CONFIG_MIPS_FP_SUPPORT
extern bool do_dsemulret(struct pt_regs *xcp); extern bool do_dsemulret(struct pt_regs *xcp);
#else
static inline bool do_dsemulret(struct pt_regs *xcp)
{
return false;
}
#endif
/** /**
* dsemul_thread_cleanup() - Cleanup thread 'emulation' frame * dsemul_thread_cleanup() - Cleanup thread 'emulation' frame
...@@ -63,8 +70,14 @@ extern bool do_dsemulret(struct pt_regs *xcp); ...@@ -63,8 +70,14 @@ extern bool do_dsemulret(struct pt_regs *xcp);
* *
* Return: True if a frame was freed, else false. * Return: True if a frame was freed, else false.
*/ */
#ifdef CONFIG_MIPS_FP_SUPPORT
extern bool dsemul_thread_cleanup(struct task_struct *tsk); extern bool dsemul_thread_cleanup(struct task_struct *tsk);
#else
static inline bool dsemul_thread_cleanup(struct task_struct *tsk)
{
return false;
}
#endif
/** /**
* dsemul_thread_rollback() - Rollback from an 'emulation' frame * dsemul_thread_rollback() - Rollback from an 'emulation' frame
* @regs: User thread register context. * @regs: User thread register context.
...@@ -77,7 +90,14 @@ extern bool dsemul_thread_cleanup(struct task_struct *tsk); ...@@ -77,7 +90,14 @@ extern bool dsemul_thread_cleanup(struct task_struct *tsk);
* *
* Return: True if a frame was exited, else false. * Return: True if a frame was exited, else false.
*/ */
#ifdef CONFIG_MIPS_FP_SUPPORT
extern bool dsemul_thread_rollback(struct pt_regs *regs); extern bool dsemul_thread_rollback(struct pt_regs *regs);
#else
static inline bool dsemul_thread_rollback(struct pt_regs *regs)
{
return false;
}
#endif
/** /**
* dsemul_mm_cleanup() - Cleanup per-mm delay slot 'emulation' state * dsemul_mm_cleanup() - Cleanup per-mm delay slot 'emulation' state
...@@ -87,6 +107,13 @@ extern bool dsemul_thread_rollback(struct pt_regs *regs); ...@@ -87,6 +107,13 @@ extern bool dsemul_thread_rollback(struct pt_regs *regs);
* for delay slot 'emulation' book-keeping is freed. This is to be called * for delay slot 'emulation' book-keeping is freed. This is to be called
* before @mm is freed in order to avoid memory leaks. * before @mm is freed in order to avoid memory leaks.
*/ */
#ifdef CONFIG_MIPS_FP_SUPPORT
extern void dsemul_mm_cleanup(struct mm_struct *mm); extern void dsemul_mm_cleanup(struct mm_struct *mm);
#else
static inline void dsemul_mm_cleanup(struct mm_struct *mm)
{
/* no-op */
}
#endif
#endif /* __MIPS_ASM_DSEMUL_H__ */ #endif /* __MIPS_ASM_DSEMUL_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment