mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-27 04:55:53 +00:00
freertos: Add newlib dynamic reentrancy support
SMP FreeRTOS adds support for dynamic reentrancy in the following commit:
34b8e24d7c
This commit does the following:
- Pulls in the upstream changes
- Move __getreent() to "freertos_tasks_c_additions.h"
- Add the required configNEWLIB_REENTRANT_IS_DYNAMIC to SMP FreeRTOS port
This commit is contained in:
@@ -2418,22 +2418,6 @@ void vTaskEndScheduler( void )
|
||||
}
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
||||
//Return global reent struct if FreeRTOS isn't running,
|
||||
struct _reent* __getreent(void) {
|
||||
//No lock needed because if this changes, we won't be running anymore.
|
||||
TCB_t *currTask=xTaskGetCurrentTaskHandle();
|
||||
if (currTask==NULL) {
|
||||
//No task running. Return global struct.
|
||||
return _GLOBAL_REENT;
|
||||
} else {
|
||||
//We have a task; return its reentrant struct.
|
||||
return &currTask->xNewLib_reent;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void vTaskSuspendAll( void )
|
||||
{
|
||||
/* A critical section is not required as the variable is of type
|
||||
|
||||
Reference in New Issue
Block a user