mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-19 11:17:43 -04:00
Update demo project for Tensilita - work in progres..
Add support for POSIX style errno - work in progress.
This commit is contained in:
parent
78d20e2854
commit
722ca8fb2b
8 changed files with 279 additions and 328 deletions
|
@ -336,6 +336,10 @@ typedef struct TaskControlBlock_t
|
|||
uint8_t ucDelayAborted;
|
||||
#endif
|
||||
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
int iTaskErrno;
|
||||
#endif
|
||||
|
||||
} tskTCB;
|
||||
|
||||
/* The old tskTCB name is maintained above then typedefed to the new TCB_t name
|
||||
|
@ -365,6 +369,12 @@ PRIVILEGED_DATA static List_t xPendingReadyList; /*< Tasks that have been r
|
|||
|
||||
#endif
|
||||
|
||||
/* Global POSIX errno. Its value is changed upon context switching to match
|
||||
the errno of the currently running task. */
|
||||
#if ( configUSE_POSIX_ERRNO == 1 )
|
||||
int FreeRTOS_errno = 0;
|
||||
#endif
|
||||
|
||||
/* Other file private variables. --------------------------------*/
|
||||
PRIVILEGED_DATA static volatile UBaseType_t uxCurrentNumberOfTasks = ( UBaseType_t ) 0U;
|
||||
PRIVILEGED_DATA static volatile TickType_t xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT;
|
||||
|
@ -2919,11 +2929,25 @@ void vTaskSwitchContext( void )
|
|||
/* Check for stack overflow, if configured. */
|
||||
taskCHECK_FOR_STACK_OVERFLOW();
|
||||
|
||||
/* Before the currently running task is switched out, save its errno. */
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
{
|
||||
pxCurrentTCB->iTaskErrno = FreeRTOS_errno;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Select a new task to run using either the generic C or port
|
||||
optimised asm code. */
|
||||
taskSELECT_HIGHEST_PRIORITY_TASK(); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
|
||||
traceTASK_SWITCHED_IN();
|
||||
|
||||
/* After the new task is switched in, update the global errno. */
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
{
|
||||
FreeRTOS_errno = pxCurrentTCB->iTaskErrno;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
||||
{
|
||||
/* Switch Newlib's _impure_ptr variable to point to the _reent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue