Module: xenomai-forge Branch: master Commit: f42718f7d91df5f592f76666a290467b3d7bc642 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f42718f7d91df5f592f76666a290467b3d7bc642
Author: Philippe Gerum <r...@xenomai.org> Date: Tue Nov 19 10:28:40 2013 +0100 cobalt/powerpc: sanitize SPE handling switchtest: we support SPE in user-space, but there is no point in checking for fprs sanity between context switches since we have no such registers in this case. kernel handling: enabling SPE implicitly means disabling HW_FPU handling in the Xenomai core, so tracking the SPE context for real-time kthreads is unsupported. However, we do have proper SPE save/restore code in our user context switching code, which enables it for real-time threads in userland. This patch is based on: http://lists.debian.org/debian-powerpc/2011/07/msg00026.html --- kernel/cobalt/arch/powerpc/Kconfig | 2 +- .../arch/powerpc/include/asm/xenomai/uapi/fptest.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kernel/cobalt/arch/powerpc/Kconfig b/kernel/cobalt/arch/powerpc/Kconfig index d0cc003..433751b 100644 --- a/kernel/cobalt/arch/powerpc/Kconfig +++ b/kernel/cobalt/arch/powerpc/Kconfig @@ -1,6 +1,6 @@ config XENO_HW_MATH_EMU bool - default y if MATH_EMU || 8XX_MINIMAL_FPEMU + default y if MATH_EMU || MATH_EMULATION menu "Hardware options" diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/fptest.h b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/fptest.h index cd85411..e6f89c9 100644 --- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/fptest.h +++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/fptest.h @@ -18,6 +18,8 @@ #ifndef _COBALT_POWERPC_ASM_UAPI_FPTEST_H #define _COBALT_POWERPC_ASM_UAPI_FPTEST_H +#ifndef __NO_FPRS__ /* i.e. has FPU, not SPE */ + static inline void fp_regs_set(int features, unsigned int val) { unsigned long long fpval = val; @@ -110,4 +112,16 @@ static inline unsigned int fp_regs_check(int features, unsigned int val, return result; } +#else /* __NO_FPRS__ */ + +static inline void fp_regs_set(int features, unsigned int val) { } + +static inline unsigned int fp_regs_check(int features, unsigned int val, + int (*report)(const char *fmt, ...)) +{ + return val; +} + +#endif /* __NO_FPRS__ */ + #endif /* !_COBALT_POWERPC_ASM_UAPI_FPTEST_H */ _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git