aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index e477c9d0498b..57c589c34147 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -669,9 +669,13 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
669 * mode (asyn, precise, disabled) for 'Classic' FP. */ 669 * mode (asyn, precise, disabled) for 'Classic' FP. */
670 if (val & PR_FP_EXC_SW_ENABLE) { 670 if (val & PR_FP_EXC_SW_ENABLE) {
671#ifdef CONFIG_SPE 671#ifdef CONFIG_SPE
672 tsk->thread.fpexc_mode = val & 672 if (cpu_has_feature(CPU_FTR_SPE)) {
673 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); 673 tsk->thread.fpexc_mode = val &
674 return 0; 674 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
675 return 0;
676 } else {
677 return -EINVAL;
678 }
675#else 679#else
676 return -EINVAL; 680 return -EINVAL;
677#endif 681#endif
@@ -697,7 +701,10 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
697 701
698 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) 702 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
699#ifdef CONFIG_SPE 703#ifdef CONFIG_SPE
700 val = tsk->thread.fpexc_mode; 704 if (cpu_has_feature(CPU_FTR_SPE))
705 val = tsk->thread.fpexc_mode;
706 else
707 return -EINVAL;
701#else 708#else
702 return -EINVAL; 709 return -EINVAL;
703#endif 710#endif