![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "os_wrapper/thread.h"
#include "os_wrapper/mutex.h"
#include "os_wrapper/semaphore.h"
#include <string.h>
#include "cmsis_os2.h"
Go to the source code of this file.
Functions | |
void * | os_wrapper_thread_new (const char *name, int32_t stack_size, os_wrapper_thread_func func, void *arg, uint32_t priority) |
Creates a new thread. More... | |
void * | os_wrapper_semaphore_create (uint32_t max_count, uint32_t initial_count, const char *name) |
Creates a new semaphore. More... | |
uint32_t | os_wrapper_semaphore_acquire (void *handle, uint32_t timeout) |
Acquires the semaphore. More... | |
uint32_t | os_wrapper_semaphore_release (void *handle) |
Releases the semaphore. More... | |
uint32_t | os_wrapper_semaphore_delete (void *handle) |
Deletes the semaphore. More... | |
void * | os_wrapper_mutex_create (void) |
Creates a mutex for mutual exclusion of resources. More... | |
uint32_t | os_wrapper_mutex_acquire (void *handle, uint32_t timeout) |
Acquires a mutex that is created by os_wrapper_mutex_create() More... | |
uint32_t | os_wrapper_mutex_release (void *handle) |
Releases the mutex acquired previously. More... | |
uint32_t | os_wrapper_mutex_delete (void *handle) |
Deletes a mutex that is created by os_wrapper_mutex_create() More... | |
void * | os_wrapper_thread_get_handle (void) |
Gets current thread handle. More... | |
uint32_t | os_wrapper_thread_get_priority (void *handle, uint32_t *priority) |
Gets thread priority. More... | |
void | os_wrapper_thread_exit (void) |
Exits the calling thread. More... | |
uint32_t | os_wrapper_thread_set_flag (void *handle, uint32_t flags) |
Set the event flags for synchronizing a thread specified by handle. More... | |
uint32_t | os_wrapper_thread_set_flag_isr (void *handle, uint32_t flags) |
Set the event flags in an interrupt handler for synchronizing a thread specified by handle. More... | |
uint32_t | os_wrapper_thread_wait_flag (uint32_t flags, uint32_t timeout) |
Wait for the event flags for synchronizing threads. More... | |
uint32_t | os_wrapper_get_tick (void) |
Return RTOS current tick count. More... | |
uint32_t os_wrapper_get_tick | ( | void | ) |
Return RTOS current tick count.
Definition at line 214 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_mutex_acquire | ( | void * | handle, |
uint32_t | timeout | ||
) |
Acquires a mutex that is created by os_wrapper_mutex_create()
[in] | handle | The handle of the mutex to acquire. Should be one of the handles returned by os_wrapper_mutex_create() |
[in] | timeout | The maximum amount of time(in tick periods) for the thread to wait for the mutex to be available. If timeout is zero, the function will return immediately. Setting timeout to OS_WRAPPER_WAIT_FOREVER will cause the thread to wait indefinitely |
Definition at line 98 of file os_wrapper_cmsis_rtos_v2.c.
void* os_wrapper_mutex_create | ( | void | ) |
Creates a mutex for mutual exclusion of resources.
Definition at line 81 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_mutex_delete | ( | void * | handle | ) |
Deletes a mutex that is created by os_wrapper_mutex_create()
[in] | handle | The handle of the mutex to be deleted |
Definition at line 132 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_mutex_release | ( | void * | handle | ) |
Releases the mutex acquired previously.
[in] | handle | The handle of the mutex that has been acquired |
Definition at line 116 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_semaphore_acquire | ( | void * | handle, |
uint32_t | timeout | ||
) |
Acquires the semaphore.
[in] | handle | Semaphore handle |
[in] | timeout | Timeout value |
Definition at line 43 of file os_wrapper_cmsis_rtos_v2.c.
void* os_wrapper_semaphore_create | ( | uint32_t | max_count, |
uint32_t | initial_count, | ||
const char * | name | ||
) |
Creates a new semaphore.
[in] | max_count | Highest count of the semaphore |
[in] | initial_count | Starting count of the available semaphore |
[in] | name | Name of the semaphore |
Definition at line 33 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_semaphore_delete | ( | void * | handle | ) |
Deletes the semaphore.
[in] | handle | Semaphore handle |
Definition at line 69 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_semaphore_release | ( | void * | handle | ) |
Releases the semaphore.
[in] | handle | Semaphore handle |
Definition at line 57 of file os_wrapper_cmsis_rtos_v2.c.
void os_wrapper_thread_exit | ( | void | ) |
Exits the calling thread.
Definition at line 167 of file os_wrapper_cmsis_rtos_v2.c.
void* os_wrapper_thread_get_handle | ( | void | ) |
Gets current thread handle.
Definition at line 148 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_thread_get_priority | ( | void * | handle, |
uint32_t * | priority | ||
) |
Gets thread priority.
[in] | handle | Thread handle |
[out] | priority | The priority of the thread |
Definition at line 153 of file os_wrapper_cmsis_rtos_v2.c.
void* os_wrapper_thread_new | ( | const char * | name, |
int32_t | stack_size, | ||
os_wrapper_thread_func | func, | ||
void * | arg, | ||
uint32_t | priority | ||
) |
Creates a new thread.
[in] | name | Name of the thread |
[in] | stack_size | Size of stack to be allocated for this thread. It can be OS_WRAPPER_DEFAULT_STACK_SIZE to use the default value provided by the underlying RTOS |
[in] | func | Pointer to the function invoked by thread |
[in] | arg | Argument to pass to the function invoked by thread |
[in] | priority | Initial thread priority |
Definition at line 17 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_thread_set_flag | ( | void * | handle, |
uint32_t | flags | ||
) |
Set the event flags for synchronizing a thread specified by handle.
[in] | handle | Thread handle to be notified |
[in] | flags | Event flags value |
Definition at line 172 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_thread_set_flag_isr | ( | void * | handle, |
uint32_t | flags | ||
) |
Set the event flags in an interrupt handler for synchronizing a thread specified by handle.
[in] | handle | Thread handle to be notified |
[in] | flags | Event flags value |
Definition at line 188 of file os_wrapper_cmsis_rtos_v2.c.
uint32_t os_wrapper_thread_wait_flag | ( | uint32_t | flags, |
uint32_t | timeout | ||
) |
Wait for the event flags for synchronizing threads.
[in] | flags | Specify the flags to wait for |
[in] | timeout | Timeout value |
Definition at line 200 of file os_wrapper_cmsis_rtos_v2.c.