7 #ifndef __TFM_THREAD_H__
8 #define __TFM_THREAD_H__
13 #include "cmsis_compiler.h"
16 #define THRD_STATE_CREATING 0
17 #define THRD_STATE_RUNNING 1
18 #define THRD_STATE_BLOCK 2
19 #define THRD_STATE_DETACH 3
20 #define THRD_STATE_INVALID 4
23 #define THRD_ATTR_SECURE_OFFSET 16
24 #define THRD_ATTR_SECURE (0)
25 #define THRD_ATTR_NON_SECURE (1 << THRD_ATTR_SECURE_OFFSET)
28 #define THRD_PRIOR_MASK 0xFF
29 #define THRD_PRIOR_HIGHEST 0x0
30 #define THRD_PRIOR_MEDIUM 0x7F
31 #define THRD_PRIOR_LOWEST 0xFF
34 #define THRD_SUCCESS 0
35 #define THRD_ERR_INVALID_PARAM 1
38 typedef void *(*tfm_core_thrd_entry_t)(
void *);
100 uint32_t attr_secure)
103 pth->
prior |= attr_secure;
void tfm_core_thrd_init(struct tfm_core_thread_t *pth, tfm_core_thrd_entry_t pfn, void *param, uintptr_t stk_top, uintptr_t stk_btm)
tfm_core_thrd_entry_t pfn
void *(* tfm_core_thrd_entry_t)(void *)
void __STATIC_INLINE tfm_core_thrd_set_retval(struct tfm_core_thread_t *pth, uint32_t retval)
void tfm_core_thrd_start_scheduler(struct tfm_core_thread_t *pth)
#define TFM_STATE_RET_VAL(ctx)
struct tfm_core_thread_t * tfm_core_thrd_get_next_thread(void)
void __STATIC_INLINE tfm_core_thrd_set_priority(struct tfm_core_thread_t *pth, uint32_t prior)
struct tfm_arch_ctx_t arch_ctx
uint32_t tfm_core_thrd_start(struct tfm_core_thread_t *pth)
void tfm_core_thrd_switch_context(struct tfm_arch_ctx_t *p_actx, struct tfm_core_thread_t *prev, struct tfm_core_thread_t *next)
#define THRD_ATTR_NON_SECURE
void __STATIC_INLINE tfm_core_thrd_set_secure(struct tfm_core_thread_t *pth, uint32_t attr_secure)
void tfm_core_thrd_set_state(struct tfm_core_thread_t *pth, uint32_t new_state)
struct tfm_core_thread_t * next
uint32_t __STATIC_INLINE tfm_core_thrd_get_state(struct tfm_core_thread_t *pth)
struct tfm_core_thread_t * tfm_core_thrd_get_curr_thread(void)
void tfm_core_thrd_activate_schedule(void)