52 #define __NO_RETURN __declspec(noreturn) 53 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 54 #define __NO_RETURN __attribute__((__noreturn__)) 55 #elif defined(__GNUC__) 56 #define __NO_RETURN __attribute__((__noreturn__)) 57 #elif defined(__ICCARM__) 58 #define __NO_RETURN __noreturn 87 osKernelSuspended = 4,
89 osKernelReserved = 0x7FFFFFFFU
98 osThreadTerminated = 4,
100 osThreadReserved = 0x7FFFFFFF
108 osPriorityLow1 = 8+1,
109 osPriorityLow2 = 8+2,
110 osPriorityLow3 = 8+3,
111 osPriorityLow4 = 8+4,
112 osPriorityLow5 = 8+5,
113 osPriorityLow6 = 8+6,
114 osPriorityLow7 = 8+7,
115 osPriorityBelowNormal = 16,
116 osPriorityBelowNormal1 = 16+1,
117 osPriorityBelowNormal2 = 16+2,
118 osPriorityBelowNormal3 = 16+3,
119 osPriorityBelowNormal4 = 16+4,
120 osPriorityBelowNormal5 = 16+5,
121 osPriorityBelowNormal6 = 16+6,
122 osPriorityBelowNormal7 = 16+7,
123 osPriorityNormal = 24,
124 osPriorityNormal1 = 24+1,
125 osPriorityNormal2 = 24+2,
126 osPriorityNormal3 = 24+3,
127 osPriorityNormal4 = 24+4,
128 osPriorityNormal5 = 24+5,
129 osPriorityNormal6 = 24+6,
130 osPriorityNormal7 = 24+7,
131 osPriorityAboveNormal = 32,
132 osPriorityAboveNormal1 = 32+1,
133 osPriorityAboveNormal2 = 32+2,
134 osPriorityAboveNormal3 = 32+3,
135 osPriorityAboveNormal4 = 32+4,
136 osPriorityAboveNormal5 = 32+5,
137 osPriorityAboveNormal6 = 32+6,
138 osPriorityAboveNormal7 = 32+7,
140 osPriorityHigh1 = 40+1,
141 osPriorityHigh2 = 40+2,
142 osPriorityHigh3 = 40+3,
143 osPriorityHigh4 = 40+4,
144 osPriorityHigh5 = 40+5,
145 osPriorityHigh6 = 40+6,
146 osPriorityHigh7 = 40+7,
147 osPriorityRealtime = 48,
148 osPriorityRealtime1 = 48+1,
149 osPriorityRealtime2 = 48+2,
150 osPriorityRealtime3 = 48+3,
151 osPriorityRealtime4 = 48+4,
152 osPriorityRealtime5 = 48+5,
153 osPriorityRealtime6 = 48+6,
154 osPriorityRealtime7 = 48+7,
156 osPriorityError = -1,
157 osPriorityReserved = 0x7FFFFFFF
161 typedef void (*osThreadFunc_t) (
void *argument);
164 typedef void (*osTimerFunc_t) (
void *argument);
173 #define osWaitForever 0xFFFFFFFFU 176 #define osFlagsWaitAny 0x00000000U 177 #define osFlagsWaitAll 0x00000001U
178 #define osFlagsNoClear 0x00000002U
181 #define osFlagsError 0x80000000U 182 #define osFlagsErrorUnknown 0xFFFFFFFFU
183 #define osFlagsErrorTimeout 0xFFFFFFFEU
184 #define osFlagsErrorResource 0xFFFFFFFDU
185 #define osFlagsErrorParameter 0xFFFFFFFCU
186 #define osFlagsErrorISR 0xFFFFFFFAU
189 #define osThreadDetached 0x00000000U 190 #define osThreadJoinable 0x00000001U
193 #define osMutexRecursive 0x00000001U 194 #define osMutexPrioInherit 0x00000002U
195 #define osMutexRobust 0x00000008U
202 osErrorResource = -3,
203 osErrorParameter = -4,
204 osErrorNoMemory = -5,
206 osStatusReserved = 0x7FFFFFFF
211 typedef void *osThreadId_t;
214 typedef void *osTimerId_t;
217 typedef void *osEventFlagsId_t;
220 typedef void *osMutexId_t;
223 typedef void *osSemaphoreId_t;
226 typedef void *osMemoryPoolId_t;
229 typedef void *osMessageQueueId_t;
232 #ifndef TZ_MODULEID_T 233 #define TZ_MODULEID_T 235 typedef uint32_t TZ_ModuleId_t;
309 osStatus_t osKernelInitialize (
void);
316 osStatus_t osKernelGetInfo (
osVersion_t *version,
char *id_buf, uint32_t id_size);
320 osKernelState_t osKernelGetState (
void);
324 osStatus_t osKernelStart (
void);
328 int32_t osKernelLock (
void);
332 int32_t osKernelUnlock (
void);
337 int32_t osKernelRestoreLock (int32_t lock);
341 uint32_t osKernelSuspend (
void);
345 void osKernelResume (uint32_t sleep_ticks);
349 uint32_t osKernelGetTickCount (
void);
353 uint32_t osKernelGetTickFreq (
void);
357 uint32_t osKernelGetSysTimerCount (
void);
361 uint32_t osKernelGetSysTimerFreq (
void);
371 osThreadId_t osThreadNew (osThreadFunc_t func,
void *argument,
const osThreadAttr_t *attr);
376 const char *osThreadGetName (osThreadId_t thread_id);
380 osThreadId_t osThreadGetId (
void);
385 osThreadState_t osThreadGetState (osThreadId_t thread_id);
390 uint32_t osThreadGetStackSize (osThreadId_t thread_id);
395 uint32_t osThreadGetStackSpace (osThreadId_t thread_id);
401 osStatus_t osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority);
406 osPriority_t osThreadGetPriority (osThreadId_t thread_id);
410 osStatus_t osThreadYield (
void);
415 osStatus_t osThreadSuspend (osThreadId_t thread_id);
420 osStatus_t osThreadResume (osThreadId_t thread_id);
425 osStatus_t osThreadDetach (osThreadId_t thread_id);
430 osStatus_t osThreadJoin (osThreadId_t thread_id);
433 __NO_RETURN
void osThreadExit (
void);
438 osStatus_t osThreadTerminate (osThreadId_t thread_id);
442 uint32_t osThreadGetCount (
void);
448 uint32_t osThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items);
457 uint32_t osThreadFlagsSet (osThreadId_t thread_id, uint32_t flags);
462 uint32_t osThreadFlagsClear (uint32_t flags);
466 uint32_t osThreadFlagsGet (
void);
473 uint32_t osThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout);
481 osStatus_t osDelay (uint32_t ticks);
486 osStatus_t osDelayUntil (uint32_t ticks);
497 osTimerId_t osTimerNew (osTimerFunc_t func, osTimerType_t type,
void *argument,
const osTimerAttr_t *attr);
502 const char *osTimerGetName (osTimerId_t timer_id);
508 osStatus_t osTimerStart (osTimerId_t timer_id, uint32_t ticks);
513 osStatus_t osTimerStop (osTimerId_t timer_id);
518 uint32_t osTimerIsRunning (osTimerId_t timer_id);
523 osStatus_t osTimerDelete (osTimerId_t timer_id);
536 const char *osEventFlagsGetName (osEventFlagsId_t ef_id);
542 uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags);
548 uint32_t osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags);
553 uint32_t osEventFlagsGet (osEventFlagsId_t ef_id);
561 uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout);
566 osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id);
579 const char *osMutexGetName (osMutexId_t mutex_id);
585 osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout);
590 osStatus_t osMutexRelease (osMutexId_t mutex_id);
595 osThreadId_t osMutexGetOwner (osMutexId_t mutex_id);
600 osStatus_t osMutexDelete (osMutexId_t mutex_id);
610 osSemaphoreId_t osSemaphoreNew (uint32_t max_count, uint32_t initial_count,
const osSemaphoreAttr_t *attr);
615 const char *osSemaphoreGetName (osSemaphoreId_t semaphore_id);
621 osStatus_t osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout);
626 osStatus_t osSemaphoreRelease (osSemaphoreId_t semaphore_id);
631 uint32_t osSemaphoreGetCount (osSemaphoreId_t semaphore_id);
636 osStatus_t osSemaphoreDelete (osSemaphoreId_t semaphore_id);
646 osMemoryPoolId_t osMemoryPoolNew (uint32_t block_count, uint32_t block_size,
const osMemoryPoolAttr_t *attr);
651 const char *osMemoryPoolGetName (osMemoryPoolId_t mp_id);
657 void *osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout);
663 osStatus_t osMemoryPoolFree (osMemoryPoolId_t mp_id,
void *block);
668 uint32_t osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id);
673 uint32_t osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id);
678 uint32_t osMemoryPoolGetCount (osMemoryPoolId_t mp_id);
683 uint32_t osMemoryPoolGetSpace (osMemoryPoolId_t mp_id);
688 osStatus_t osMemoryPoolDelete (osMemoryPoolId_t mp_id);
698 osMessageQueueId_t osMessageQueueNew (uint32_t msg_count, uint32_t msg_size,
const osMessageQueueAttr_t *attr);
703 const char *osMessageQueueGetName (osMessageQueueId_t mq_id);
711 osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id,
const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
719 osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id,
void *msg_ptr, uint8_t *msg_prio, uint32_t timeout);
724 uint32_t osMessageQueueGetCapacity (osMessageQueueId_t mq_id);
729 uint32_t osMessageQueueGetMsgSize (osMessageQueueId_t mq_id);
734 uint32_t osMessageQueueGetCount (osMessageQueueId_t mq_id);
739 uint32_t osMessageQueueGetSpace (osMessageQueueId_t mq_id);
744 osStatus_t osMessageQueueReset (osMessageQueueId_t mq_id);
749 osStatus_t osMessageQueueDelete (osMessageQueueId_t mq_id);
756 #endif // CMSIS_OS2_H_ uint32_t attr_bits
attribute bits
TZ_ModuleId_t tz_module
TrustZone module identifier.
void * cb_mem
memory for control block
uint32_t api
API version (major.minor.rev: mmnnnrrrr dec).
Attributes structure for thread.
uint32_t stack_size
size of stack
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
uint32_t cb_size
size of provided memory for control block
Attributes structure for memory pool.
void * stack_mem
memory for stack
uint32_t attr_bits
attribute bits
void * cb_mem
memory for control block
const char * name
name of the event flags
Attributes structure for event flags.
const char * name
name of the timer
void * cb_mem
memory for control block
Attributes structure for message queue.
void * mp_mem
memory for data storage
void * cb_mem
memory for control block
const char * name
name of the semaphore
uint32_t cb_size
size of provided memory for control block
const char * name
name of the memory pool
Attributes structure for timer.
void * cb_mem
memory for control block
const char * name
name of the mutex
uint32_t attr_bits
attribute bits
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
uint32_t kernel
Kernel version (major.minor.rev: mmnnnrrrr dec).
Attributes structure for semaphore.
osPriority_t priority
initial thread priority (default: osPriorityNormal)
uint32_t cb_size
size of provided memory for control block
void * cb_mem
memory for control block
void * cb_mem
memory for control block
uint32_t attr_bits
attribute bits
const char * name
name of the thread
uint32_t mq_size
size of provided memory for data storage
uint32_t attr_bits
attribute bits
Attributes structure for mutex.
const char * name
name of the message queue
void * mq_mem
memory for data storage
uint32_t reserved
reserved (must be 0)
uint32_t mp_size
size of provided memory for data storage
uint32_t cb_size
size of provided memory for control block
uint32_t cb_size
size of provided memory for control block