From: richardbarry Date: Thu, 9 May 2013 09:52:34 +0000 (+0000) Subject: Update flop.c and FreeRTOS.h to include a macro (and a default null implementation... X-Git-Tag: V7.5.0~103 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2e4f977689e376c3dfcc17f59c5bc6767de7f7cd;p=freertos Update flop.c and FreeRTOS.h to include a macro (and a default null implementation of the macro) that enables the flop tasks to register their need for a floating point context with the kernel. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1887 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Demo/Common/Minimal/flop.c b/FreeRTOS/Demo/Common/Minimal/flop.c index dc9d25b50..0d3673da5 100644 --- a/FreeRTOS/Demo/Common/Minimal/flop.c +++ b/FreeRTOS/Demo/Common/Minimal/flop.c @@ -132,6 +132,11 @@ volatile unsigned short *pusTaskCheckVariable; volatile portDOUBLE dAnswer; short sError = pdFALSE; + /* Some ports require that tasks that use a hardware floating point unit + tell the kernel that they require a floating point context before any + floating point instructions are executed. */ + portTASK_USES_FLOATING_POINT(); + d1 = 123.4567; d2 = 2345.6789; d3 = -918.222; @@ -184,6 +189,11 @@ volatile unsigned short *pusTaskCheckVariable; volatile portDOUBLE dAnswer; short sError = pdFALSE; + /* Some ports require that tasks that use a hardware floating point unit + tell the kernel that they require a floating point context before any + floating point instructions are executed. */ + portTASK_USES_FLOATING_POINT(); + d1 = -389.38; d2 = 32498.2; d3 = -2.0001; @@ -238,6 +248,11 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; + /* Some ports require that tasks that use a hardware floating point unit + tell the kernel that they require a floating point context before any + floating point instructions are executed. */ + portTASK_USES_FLOATING_POINT(); + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; @@ -295,6 +310,11 @@ const size_t xArraySize = 10; size_t xPosition; short sError = pdFALSE; + /* Some ports require that tasks that use a hardware floating point unit + tell the kernel that they require a floating point context before any + floating point instructions are executed. */ + portTASK_USES_FLOATING_POINT(); + /* The variable this task increments to show it is still running is passed in as the parameter. */ pusTaskCheckVariable = ( unsigned short * ) pvParameters; diff --git a/FreeRTOS/Source/include/FreeRTOS.h b/FreeRTOS/Source/include/FreeRTOS.h index f29380f6f..eb3b2a50e 100644 --- a/FreeRTOS/Source/include/FreeRTOS.h +++ b/FreeRTOS/Source/include/FreeRTOS.h @@ -568,6 +568,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * ); #define configUSE_QUEUE_SETS 0 #endif +#ifndef portTASK_USES_FLOATING_POINT + #define portTASK_USES_FLOATING_POINT() +#endif + /* For backward compatability. */ #define eTaskStateGet eTaskGetState