|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Minimal FreeRTOS task compatibility APIs. More...
Go to the source code of this file.
Macros | |
| #define | INC_TASK_H |
| #define | xTaskCreate(...) |
| Task creation API. | |
| #define | xTaskCreateStatic(...) |
| Task creation API. | |
Functions | |
| static void | vTaskSetTimeOutState (TimeOut_t *timeout) |
| Initialise a timeout with the current number of elapsed ticks. | |
| static BaseType_t | xTaskCheckForTimeOut (TimeOut_t *pxTimeOut, TickType_t *pxTicksToWait) |
| Return whether a timeout has expired. | |
| static void | vTaskDelay (const TickType_t xTicksToDelay) |
| Block the current thread for a given number of ticks. | |
| static TickType_t | xTaskGetTickCount (void) |
| Return the number of ticks elapsed since the system booted. | |
| static TaskHandle_t | xTaskGetCurrentTaskHandle (void) |
| Returns the current thread ID. | |
| static void | taskENTER_CRITICAL (void) |
| Critical section. | |
| static void | taskEXIT_CRITICAL (void) |
| Exit a critical section entered with taskENTER_CRITICAL. | |
| static void | vTaskSuspendAll (void) |
| Critical section. | |
| static BaseType_t | xTaskResumeAll (void) |
| Exit a critical section entered with vTaskSuspendAll. | |
| static void | vTaskResumeAll (void) |
| Exit a critical section entered with vTaskSuspendAll. | |
Variables | |
| struct RecursiveMutexState | __CriticalSectionFlagLock |
| Lock used to simulate disabling interrupts in taskENTER_CRITICAL and taskEXIT_CRITICAL. | |
| struct RecursiveMutexState | __SuspendFlagLock |
| Lock used to simulate disabling interrupts in vTaskSuspendAll and xTaskResumeAll. | |
Minimal FreeRTOS task compatibility APIs.
This file defines the compatibility wrappers for FreeRTOS's task APIs.
FreeRTOS's task abstraction is similar to a UNIX process and does not map directly to a CHERIoT RTOS concept. CHERIoT RTOS also does not support dynamic thread creation and so the task-creation APIs are defined to give compile-time errors.
Definition in file task.h.
| #define xTaskCreate | ( | ... | ) |
Task creation API.
CHERIoT RTOS does not permit dynamic thread creation and so this simply provides a warning so that ported code can be modified to avoid the API.
| #define xTaskCreateStatic | ( | ... | ) |
Task creation API.
CHERIoT RTOS does not permit dynamic thread creation and so this simply provides a warning so that ported code can be modified to avoid the API.
|
inlinestatic |
Critical section.
This acquires a recursive mutex. In FreeRTOS, this disables interrupts. The CHERIoT RTOS security model does not permit interrupts to be arbitrarily disabled, only for designated scopes. Callers of this should be carefully audited to ensure that they are safe.
Definition at line 118 of file task.h.
References __CriticalSectionFlagLock, recursivemutex_trylock(), and UnlimitedTimeout.
|
inlinestatic |
Exit a critical section entered with taskENTER_CRITICAL.
Definition at line 127 of file task.h.
References __CriticalSectionFlagLock, and recursivemutex_unlock().
|
inlinestatic |
Block the current thread for a given number of ticks.
Definition at line 67 of file task.h.
References thread_sleep(), and ThreadSleepNoEarlyWake.
|
inlinestatic |
Exit a critical section entered with vTaskSuspendAll.
Definition at line 156 of file task.h.
References __SuspendFlagLock, and recursivemutex_unlock().
|
inlinestatic |
Initialise a timeout with the current number of elapsed ticks.
This is used in a blocking function in conjunction with xTaskCheckForTimeOut(). The value returned here should be passed as the first argument of xTaskCheckForTimeOut().
Definition at line 25 of file task.h.
References SystickReturn::hi, and SystickReturn::lo.
Referenced by xTaskCheckForTimeOut().
|
inlinestatic |
Critical section.
This acquires a recursive mutex. In FreeRTOS, this disables interrupts. The CHERIoT RTOS security model does not permit interrupts to be arbitrarily disabled, only for designated scopes. Callers of this should be carefully audited to ensure that they are safe.
Definition at line 138 of file task.h.
References __SuspendFlagLock, recursivemutex_trylock(), and UnlimitedTimeout.
|
inlinestatic |
Return whether a timeout has expired.
The first argument should be a pointer to the value returned by vTaskSetTimeOutState() before any blocking operations. The second argument is the number of ticks to wait. This function returns pdTRUE if the timeout has expired, or pdFALSE if the timeout has not expired, and updates the arguments to reflect the remaining time to wait.
Definition at line 39 of file task.h.
References pdFALSE, pdTRUE, and vTaskSetTimeOutState().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Exit a critical section entered with vTaskSuspendAll.
Definition at line 147 of file task.h.
References __SuspendFlagLock, pdTRUE, and recursivemutex_unlock().
|
extern |
Lock used to simulate disabling interrupts in taskENTER_CRITICAL and taskEXIT_CRITICAL.
Code using these APIs must provide a definition to accompany this declaration.
Referenced by taskENTER_CRITICAL(), and taskEXIT_CRITICAL().
|
extern |
Lock used to simulate disabling interrupts in vTaskSuspendAll and xTaskResumeAll.
Code using these APIs must provide a definition to accompany this declaration.
Referenced by vTaskResumeAll(), vTaskSuspendAll(), and xTaskResumeAll().