TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
thread.h File Reference
#include "common.h"
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* os_wrapper_thread_func )(void *argument)
 

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_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...
 

Typedef Documentation

typedef void(* os_wrapper_thread_func)(void *argument)

Definition at line 18 of file thread.h.

Function Documentation

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.

Returns
Returns the thread handle, or NULL in case of error

Definition at line 148 of file os_wrapper_cmsis_rtos_v2.c.

Here is the caller graph for this function:

uint32_t os_wrapper_thread_get_priority ( void *  handle,
uint32_t *  priority 
)

Gets thread priority.

Parameters
[in]handleThread handle
[out]priorityThe priority of the thread
Returns
Returns OS_WRAPPER_SUCCESS on success, or OS_WRAPPER_ERROR in case of error

Definition at line 153 of file os_wrapper_cmsis_rtos_v2.c.

Here is the caller graph for this function:

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.

Parameters
[in]nameName of the thread
[in]stack_sizeSize 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]funcPointer to the function invoked by thread
[in]argArgument to pass to the function invoked by thread
[in]priorityInitial thread priority
Returns
Returns the thread handle created, or NULL in case of error

Definition at line 17 of file os_wrapper_cmsis_rtos_v2.c.

Here is the caller graph for this function:

uint32_t os_wrapper_thread_set_flag ( void *  handle,
uint32_t  flags 
)

Set the event flags for synchronizing a thread specified by handle.

Note
This function may not be allowed to be called from Interrupt Service Routines.
Parameters
[in]handleThread handle to be notified
[in]flagsEvent flags value
Returns
Returns OS_WRAPPER_SUCCESS on success, or OS_WRAPPER_ERROR in case of error

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.

Parameters
[in]handleThread handle to be notified
[in]flagsEvent flags value
Returns
Returns OS_WRAPPER_SUCCESS on success, or OS_WRAPPER_ERROR in case of error

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.

Note
This function may not be allowed to be called from Interrupt Service Routines.
Parameters
[in]flagsSpecify the flags to wait for
[in]timeoutTimeout value
Returns
Returns OS_WRAPPER_SUCCESS on success, or OS_WRAPPER_ERROR in case of error

Definition at line 200 of file os_wrapper_cmsis_rtos_v2.c.