#include <stdint.h>
#include <stdbool.h>
#include "cmsis_compiler.h"
#include "tfm_core_trustzone.h"
#include "utilities.h"
Go to the source code of this file.
#define EXC_RETURN_EXC_SECURE (1) |
#define EXC_RETURN_FPU_FRAME_BASIC (1 << 4) |
#define EXC_RETURN_INDICATOR (0xFF << 24) |
#define EXC_RETURN_MODE_THREAD (1 << 3) |
#define EXC_RETURN_RES0 (0 << 1) |
#define EXC_RETURN_RES1 (0x1FFFF << 7) |
#define EXC_RETURN_SECURE_STACK (1 << 6) |
#define EXC_RETURN_STACK_PROCESS (1 << 2) |
#define EXC_RETURN_STACK_RULE (1 << 5) |
#define EXC_RETURN_THREAD_S_PSP |
Value:
#define EXC_RETURN_EXC_SECURE
#define EXC_RETURN_STACK_PROCESS
#define EXC_RETURN_FPU_FRAME_BASIC
#define EXC_RETURN_MODE_THREAD
#define EXC_RETURN_STACK_RULE
#define EXC_RETURN_INDICATOR
#define EXC_RETURN_SECURE_STACK
Definition at line 28 of file tfm_arch_v8m.h.
#define TFM_NS_EXC_DISABLE |
( |
| ) |
__TZ_set_PRIMASK_NS(1) |
#define TFM_NS_EXC_ENABLE |
( |
| ) |
__TZ_set_PRIMASK_NS(0) |
__STATIC_INLINE bool is_return_secure_stack |
( |
uint32_t |
lr | ) |
|
Check whether Secure or Non-secure stack is used to restore stack frame on exception return.
- Parameters
-
[in] | lr | LR register containing the EXC_RETURN value. |
- Return values
-
true | Secure stack is used to restore stack frame on exception return. |
false | Non-secure stack is used to restore stack frame on exception return. |
Definition at line 83 of file tfm_arch_v8m.h.
__STATIC_INLINE bool is_stack_alloc_fp_space |
( |
uint32_t |
lr | ) |
|
Check whether the stack frame for this exception has space allocated for Floating Point(FP) state information.
- Parameters
-
[in] | lr | LR register containing the EXC_RETURN value. |
- Return values
-
true | The stack allocates space for FP information |
false | The stack doesn't allocate space for FP information |
Definition at line 97 of file tfm_arch_v8m.h.
__STATIC_INLINE void tfm_arch_init_secure_msp |
( |
uint32_t |
msplim | ) |
|
Set MSPLIM register and seal the MSP.
This function assumes that the caller is using PSP when calling this function.
- Parameters
-
[in] | msplim | Register value to be written into MSPLIM. |
Definition at line 151 of file tfm_arch_v8m.h.
__STATIC_INLINE uintptr_t tfm_arch_seal_thread_stack |
( |
uintptr_t |
stk | ) |
|
Seal the thread stack.
This function must be called only when the caller is using MSP.
- Parameters
-
[in] | stk | Thread stack address. |
- Return values
-
stack | Updated thread stack address. |
Definition at line 121 of file tfm_arch_v8m.h.
__STATIC_INLINE void tfm_arch_set_psplim |
( |
uint32_t |
psplim | ) |
|
Set PSPLIM register.
- Parameters
-
[in] | psplim | Register value to be written into PSPLIM. |
Definition at line 107 of file tfm_arch_v8m.h.
__STATIC_INLINE void tfm_arch_update_ctx |
( |
struct tfm_arch_ctx_t * |
p_actx | ) |
|
Update architecture context value into hardware.
- Parameters
-
[in] | p_actx | Pointer of context data |
Definition at line 137 of file tfm_arch_v8m.h.