16 #define SPM_PARTITION_STATE_UNINIT 0
17 #define SPM_PARTITION_STATE_IDLE 1
18 #define SPM_PARTITION_STATE_RUNNING 2
19 #define SPM_PARTITION_STATE_HANDLING_IRQ 3
20 #define SPM_PARTITION_STATE_SUSPENDED 4
21 #define SPM_PARTITION_STATE_BLOCKED 5
22 #define SPM_PARTITION_STATE_CLOSED 6
24 #define EXC_NUM_THREAD_MODE (0)
25 #define EXC_NUM_SVCALL (11)
26 #define EXC_NUM_PENDSV (14)
27 #define EXC_NUM_SYSTICK (15)
29 #define SPM_INVALID_PARTITION_IDX (~0U)
32 #define TFM_PARTITION_UNPRIVILEGED_MODE 0
33 #define TFM_PARTITION_PRIVILEGED_MODE 1
35 #define SPM_PART_FLAG_APP_ROT 0x01
36 #define SPM_PART_FLAG_PSA_ROT 0x02
37 #define SPM_PART_FLAG_IPC 0x04
39 #define TFM_PRIORITY_HIGH 0
40 #define TFM_PRIORITY_NORMAL 0x7F
41 #define TFM_PRIORITY_LOW 0xFF
42 #define TFM_PRIORITY(LEVEL) TFM_PRIORITY_##LEVEL
257 const int32_t *args);
295 const uint32_t *svc_args, uint32_t
lr);
void tfm_spm_psa_eoi(uint32_t *svc_args)
Handle request to record IRQ processed.
uint32_t partition_priority
void(* sp_entry_point)(void)
enum spm_err_t tfm_spm_db_init(void)
Initialize partition database.
void tfm_spm_memory_permission_check_handler(uint32_t *svc_args)
Checks if a secure service's access to a memory location is permitted.
uint32_t caller_partition_idx
uint32_t tfm_spm_partition_get_privileged_mode(uint32_t partition_flags)
Get the current partition mode.
const struct spm_partition_runtime_data_t * tfm_spm_partition_get_runtime_data(uint32_t partition_idx)
Get the current runtime data of a partition.
const struct tfm_spm_partition_platform_data_t ** platform_data_list
uint32_t tfm_spm_depriv_req_handler(uint32_t *svc_args, uint32_t excReturn)
Handle deprivileged request.
void tfm_spm_partition_set_caller_client_id(uint32_t partition_idx, int32_t caller_client_id)
Set the caller client ID for a given partition.
struct spm_partition_runtime_data_t runtime_data
void tfm_spm_partition_set_state(uint32_t partition_idx, uint32_t state)
Set the current state of a partition.
sp_entry_point partition_init
void tfm_spm_disable_irq_handler(uint32_t *svc_args)
Handle IRQ disable request.
void tfm_spm_partition_push_handler_ctx(uint32_t partition_idx)
Save handler partition context on ctx stack.
psa_outvec out_vec[PSA_MAX_IOVEC]
void tfm_spm_partition_set_caller_partition_idx(uint32_t partition_idx, uint32_t caller_partition_idx)
Set the caller partition index for a given partition.
const struct spm_partition_static_data_t * static_data
uint32_t tfm_spm_partition_return_handler(uint32_t lr)
Called when secure service returns.
uint32_t running_partition_idx
void tfm_spm_partition_set_signal_mask(uint32_t partition_idx, uint32_t signal_mask)
Set the signal mask for a given partition.
Runtime context information of a partition.
int32_t tfm_spm_check_buffer_access(uint32_t partition_idx, void *start_addr, size_t len, uint32_t alignment)
Check whether a buffer is ok for writing to by the privileged API function.
void tfm_spm_get_caller_client_id_handler(uint32_t *svc_args)
Stores caller's client id in state context.
void tfm_spm_psa_wait(uint32_t *svc_args)
Handle signal wait request.
void tfm_spm_secure_api_init_done(void)
Signal that secure partition initialisation is finished.
uint32_t dependencies_num
void tfm_spm_enable_irq_handler(uint32_t *svc_args)
Handle IRQ enable request.
void tfm_spm_request_handler(const struct tfm_state_context_t *svc_ctx)
Handle an SPM request by a secure service.
enum spm_err_t tfm_spm_partition_set_iovec(uint32_t partition_idx, const int32_t *args)
Set the iovec parameters for the partition.
void tfm_spm_seal_psp_stacks(void)
Function to seal the PSP stacks for Function mode.
enum spm_err_t tfm_spm_partition_init(void)
Execute partition init function.
uint32_t tfm_spm_partition_request_svc_handler(const uint32_t *svc_args, uint32_t lr)
Called if veneer is running in thread mode.
struct iovec_args_t iovec_args
void tfm_spm_partition_cleanup_context(uint32_t partition_idx)
Clears the context info from the database for a partition.
uint32_t tfm_spm_partition_get_partition_id(uint32_t partition_idx)
Get the id of the partition for its index from the db.
void tfm_spm_partition_pop_interrupted_ctx(uint32_t partition_idx)
Restores interrupted partition context on ctx stack.
void tfm_spm_partition_pop_handler_ctx(uint32_t partition_idx)
Restores handler partition context on ctx stack.
void tfm_spm_partition_store_context(uint32_t partition_idx, uint32_t stack_ptr, uint32_t lr)
Save stack pointer and link register for partition in database.
struct spm_partition_desc_t * partitions
uint32_t tfm_spm_partition_get_running_partition_idx(void)
Returns the index of the partition that has running state.
Holds the iovec parameters that are passed to a service.
uint32_t tfm_spm_depriv_return_handler(uint32_t *irq_svc_args, uint32_t lr)
Handle request to return to privileged.
psa_invec in_vec[PSA_MAX_IOVEC]
void tfm_spm_partition_push_interrupted_ctx(uint32_t partition_idx)
Save interrupted partition context on ctx stack.
uint32_t caller_partition_idx