28 *timeout = ((uint64_t)ret.
hi << 32) | ret.
lo;
48 xElapsedTime = timeBlock - *pxTimeOut;
49 if (xElapsedTime < *pxTicksToWait)
51 *pxTicksToWait -= xElapsedTime;
52 *pxTimeOut = timeBlock;
69 struct Timeout timeout = {0, xTicksToDelay};
83 return thread_systemtick_get().lo;
166#define xTaskCreate(...) \
167 _Pragma("GCC warning \"Dynamic thread creation is not supported\"")( \
176#define xTaskCreateStatic(...) \
177 _Pragma("GCC warning \"Dynamic thread creation is not supported\"")( \
int32_t BaseType_t
FreeRTOS default signed integer type.
Ticks TickType_t
FreeRTOS type for durations expressed in ticks.
#define pdFALSE
FreeRTOS definition of false.
uint16_t TaskHandle_t
FreeRTOS type representing a task handle, mapped to a thread ID in CHERIoT RTOS.
uint64_t TimeOut_t
FreeRTOS type for a duration expressed in large numbers of ticks.
#define pdTRUE
FreeRTOS definition of true.
C compatible interface to synchronisation primitives.
int __cheri_libcall recursivemutex_unlock(struct RecursiveMutexState *mutex)
Unlock a recursive mutex.
int __cheri_libcall recursivemutex_trylock(TimeoutArgument timeout, struct RecursiveMutexState *lock)
Try to acquire a recursive mutex.
State for a recursive mutex.
the absolute system tick value since boot, 64-bit, assuming never overflows
uint32_t lo
low 32 bits of the system tick
Structure representing a timeout.
static TaskHandle_t xTaskGetCurrentTaskHandle(void)
Returns the current thread ID.
static BaseType_t xTaskCheckForTimeOut(TimeOut_t *pxTimeOut, TickType_t *pxTicksToWait)
Return whether a timeout has expired.
static void taskENTER_CRITICAL(void)
Critical section.
static void taskEXIT_CRITICAL(void)
Exit a critical section entered with taskENTER_CRITICAL.
static void vTaskSetTimeOutState(TimeOut_t *timeout)
Initialise a timeout with the current number of elapsed ticks.
static void vTaskDelay(const TickType_t xTicksToDelay)
Block the current thread for a given number of ticks.
struct RecursiveMutexState __CriticalSectionFlagLock
Lock used to simulate disabling interrupts in taskENTER_CRITICAL and taskEXIT_CRITICAL.
static void vTaskResumeAll(void)
Exit a critical section entered with vTaskSuspendAll.
struct RecursiveMutexState __SuspendFlagLock
Lock used to simulate disabling interrupts in vTaskSuspendAll and xTaskResumeAll.
static BaseType_t xTaskResumeAll(void)
Exit a critical section entered with vTaskSuspendAll.
static void vTaskSuspendAll(void)
Critical section.
static TickType_t xTaskGetTickCount(void)
Return the number of ticks elapsed since the system booted.
Functions and types used for thread management.
int thread_sleep(TimeoutArgument timeout, uint32_t flags)
Sleep for at most the specified timeout (see timeout.h).
@ ThreadSleepNoEarlyWake
Sleep for up to the specified timeout, but wake early if there are no other runnable threads.
uint16_t __cheri_libcall thread_id_get(__if_c(void))
Return the thread ID of the current running thread.
static const Ticks UnlimitedTimeout
Value indicating an unbounded timeout for use with Timeout.