From a51b3526eac244db59ccdf582e1921ddcd969e5c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 30 May 2015 17:48:27 +0200 Subject: sparc: Add SPARC_USE_SAFE_FP_SUPPORT The SPARC ABI is a bit special with respect to the floating point context. The complete floating point context is volatile. Thus from an ABI point of view nothing needs to be saved and restored during a context switch. Instead the floating point context must be saved and restored during interrupt processing. Historically the deferred floating point switch is used for SPARC and the complete floating point context is saved and restored during a context switch to the new floating point unit owner. This is a bit dangerous since post-switch actions (e.g. signal handlers) and context switch extensions may silently corrupt the floating point context. The floating point unit is disabled for interrupt handlers. Thus in case an interrupt handler uses the floating point unit then this will result in a trap. On SMP configurations the deferred floating point switch is not supported in principle. So use here a safe floating point support. Safe means that the volatile floating point context is saved and restored around a thread dispatch issued during interrupt processing. Thus post-switch actions and context switch extensions may safely use the floating point unit. Update #2270. --- cpukit/score/cpu/sparc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpukit/score/cpu/sparc/cpu.c') diff --git a/cpukit/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c index bab0040058..569b6f8ec8 100644 --- a/cpukit/score/cpu/sparc/cpu.c +++ b/cpukit/score/cpu/sparc/cpu.c @@ -131,7 +131,7 @@ RTEMS_STATIC_ASSERT( void _CPU_Initialize(void) { -#if (SPARC_HAS_FPU == 1) +#if (SPARC_HAS_FPU == 1) && !defined(SPARC_USE_SAFE_FP_SUPPORT) Context_Control_fp *pointer; uint32_t psr; -- cgit v1.2.3