#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0\r
#endif\r
\r
+#ifndef configUSE_NEWLIB_REENTRANT\r
+ #define configUSE_NEWLIB_REENTRANT 0\r
+#endif\r
+\r
/* For backward compatability. */\r
#define eTaskStateGet eTaskGetState\r
\r
unsigned long ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */\r
#endif\r
\r
+ #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+ /* Allocate a Newlib reent structure that is specific to this task.\r
+ Note Newlib support has been included by popular demand, but is not\r
+ used by the FreeRTOS maintainers themselves, and therefore receives\r
+ less rigorous testing than the rest of the FreeRTOS code. */\r
+ struct _reent xNewLib_reent;\r
+ #endif\r
+\r
} tskTCB;\r
\r
\r
taskSELECT_HIGHEST_PRIORITY_TASK();\r
\r
traceTASK_SWITCHED_IN();\r
+\r
+ #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+ {\r
+ /* Switch Newlib's _impure_ptr variable to point to the _reent\r
+ structure specific to this task. */\r
+ _impure_ptr = &( pxCurrentTCB->xNewLib_reent );\r
+ }\r
+ #endif /* configUSE_NEWLIB_REENTRANT */\r
}\r
}\r
/*-----------------------------------------------------------*/\r
( void ) usStackDepth;\r
}\r
#endif /* portUSING_MPU_WRAPPERS */\r
+\r
+ #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+ {\r
+ /* Initialise this task's Newlib reent structure. */\r
+ _REENT_INIT_PTR( ( &( pxTCB->xNewLib_reent ) ) );\r
+ }\r
+ #endif /* configUSE_NEWLIB_REENTRANT */\r
}\r
/*-----------------------------------------------------------*/\r
\r