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:
Darian Leung
2022-06-01 23:16:11 +08:00
parent 2d08431433
commit d8eb55d83b
5 changed files with 45 additions and 50 deletions

View File

@@ -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