Commit 2725f377 authored by Paul Burton's avatar Paul Burton

MIPS: Remove struct task_struct fpu state when CONFIG_MIPS_FP_SUPPORT=n

When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point & so don't
need to preserve floating point context for tasks. Remove that context
from struct task_struct.
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21013/
Cc: linux-mips@linux-mips.org
parent 42b10815
...@@ -255,8 +255,10 @@ struct thread_struct { ...@@ -255,8 +255,10 @@ struct thread_struct {
/* Saved cp0 stuff. */ /* Saved cp0 stuff. */
unsigned long cp0_status; unsigned long cp0_status;
#ifdef CONFIG_MIPS_FP_SUPPORT
/* Saved fpu/fpu emulator stuff. */ /* Saved fpu/fpu emulator stuff. */
struct mips_fpu_struct fpu FPU_ALIGN; struct mips_fpu_struct fpu FPU_ALIGN;
#endif
/* Assigned branch delay slot 'emulation' frame */ /* Assigned branch delay slot 'emulation' frame */
atomic_t bd_emu_frame; atomic_t bd_emu_frame;
/* PC of the branch from a branch delay slot 'emulation' */ /* PC of the branch from a branch delay slot 'emulation' */
...@@ -299,6 +301,17 @@ struct thread_struct { ...@@ -299,6 +301,17 @@ struct thread_struct {
#define FPAFF_INIT #define FPAFF_INIT
#endif /* CONFIG_MIPS_MT_FPAFF */ #endif /* CONFIG_MIPS_MT_FPAFF */
#ifdef CONFIG_MIPS_FP_SUPPORT
# define FPU_INIT \
.fpu = { \
.fpr = {{{0,},},}, \
.fcr31 = 0, \
.msacsr = 0, \
},
#else
# define FPU_INIT
#endif
#define INIT_THREAD { \ #define INIT_THREAD { \
/* \ /* \
* Saved main processor registers \ * Saved main processor registers \
...@@ -321,11 +334,7 @@ struct thread_struct { ...@@ -321,11 +334,7 @@ struct thread_struct {
/* \ /* \
* Saved FPU/FPU emulator stuff \ * Saved FPU/FPU emulator stuff \
*/ \ */ \
.fpu = { \ FPU_INIT \
.fpr = {{{0,},},}, \
.fcr31 = 0, \
.msacsr = 0, \
}, \
/* \ /* \
* FPU affinity state (null if not FPAFF) \ * FPU affinity state (null if not FPAFF) \
*/ \ */ \
......
...@@ -123,7 +123,6 @@ void output_thread_defines(void) ...@@ -123,7 +123,6 @@ void output_thread_defines(void)
OFFSET(THREAD_REG31, task_struct, thread.reg31); OFFSET(THREAD_REG31, task_struct, thread.reg31);
OFFSET(THREAD_STATUS, task_struct, OFFSET(THREAD_STATUS, task_struct,
thread.cp0_status); thread.cp0_status);
OFFSET(THREAD_FPU, task_struct, thread.fpu);
OFFSET(THREAD_BVADDR, task_struct, \ OFFSET(THREAD_BVADDR, task_struct, \
thread.cp0_badvaddr); thread.cp0_badvaddr);
...@@ -135,8 +134,11 @@ void output_thread_defines(void) ...@@ -135,8 +134,11 @@ void output_thread_defines(void)
BLANK(); BLANK();
} }
#ifdef CONFIG_MIPS_FP_SUPPORT
void output_thread_fpu_defines(void) void output_thread_fpu_defines(void)
{ {
OFFSET(THREAD_FPU, task_struct, thread.fpu);
OFFSET(THREAD_FPR0, task_struct, thread.fpu.fpr[0]); OFFSET(THREAD_FPR0, task_struct, thread.fpu.fpr[0]);
OFFSET(THREAD_FPR1, task_struct, thread.fpu.fpr[1]); OFFSET(THREAD_FPR1, task_struct, thread.fpu.fpr[1]);
OFFSET(THREAD_FPR2, task_struct, thread.fpu.fpr[2]); OFFSET(THREAD_FPR2, task_struct, thread.fpu.fpr[2]);
...@@ -174,6 +176,7 @@ void output_thread_fpu_defines(void) ...@@ -174,6 +176,7 @@ void output_thread_fpu_defines(void)
OFFSET(THREAD_MSA_CSR, task_struct, thread.fpu.msacsr); OFFSET(THREAD_MSA_CSR, task_struct, thread.fpu.msacsr);
BLANK(); BLANK();
} }
#endif
void output_mm_defines(void) void output_mm_defines(void)
{ {
...@@ -341,6 +344,7 @@ void output_pm_defines(void) ...@@ -341,6 +344,7 @@ void output_pm_defines(void)
} }
#endif #endif
#ifdef CONFIG_MIPS_FP_SUPPORT
void output_kvm_defines(void) void output_kvm_defines(void)
{ {
COMMENT(" KVM/MIPS Specific offsets. "); COMMENT(" KVM/MIPS Specific offsets. ");
...@@ -382,6 +386,7 @@ void output_kvm_defines(void) ...@@ -382,6 +386,7 @@ void output_kvm_defines(void)
OFFSET(VCPU_MSA_CSR, kvm_vcpu_arch, fpu.msacsr); OFFSET(VCPU_MSA_CSR, kvm_vcpu_arch, fpu.msacsr);
BLANK(); BLANK();
} }
#endif
#ifdef CONFIG_MIPS_CPS #ifdef CONFIG_MIPS_CPS
void output_cps_defines(void) void output_cps_defines(void)
......
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