17 #include "tfm_hal_platform.h"
20 #include "tfm_spm_hal.h"
43 sid = (uint32_t)args[0];
54 sid = (uint32_t)args[0];
55 version = (uint32_t)args[1];
65 size_t in_num, out_num;
91 spm_memcpy(&ctrl_param, (
const void *)args[1],
sizeof(ctrl_param));
93 type = ctrl_param.
type;
94 in_num = ctrl_param.
in_len;
105 ns_caller, privileged);
243 void *rhandle = NULL;
249 rhandle = (
void *)args[1];
278 buffer = (
void *)args[2];
279 num_bytes = (size_t)args[3];
321 bytes = num_bytes > msg->
msg.
in_size[invec_idx] ?
343 num_bytes = (size_t)args[2];
376 if (num_bytes > msg->
msg.
in_size[invec_idx]) {
400 outvec_idx = args[1];
401 buffer = (
void *)args[2];
402 num_bytes = (size_t)args[3];
449 msg->
outvec[outvec_idx].
len, buffer, num_bytes);
452 msg->
outvec[outvec_idx].
len += num_bytes;
557 int32_t partition_id;
560 partition_id = (int32_t)args[0];
587 IRQn_Type irq_line = (IRQn_Type) 0;
605 irq_signal, &irq_line);
618 tfm_spm_hal_clear_pending_irq(irq_line);
619 tfm_spm_hal_enable_irq(irq_line);
628 tfm_hal_system_reset();
void tfm_spm_psa_eoi(uint32_t *args)
Handle request to record IRQ processed.
void tfm_spm_psa_set_rhandle(uint32_t *args)
SVC handler for psa_set_rhandle.
#define PSA_ERROR_CONNECTION_BUSY
uint32_t tfm_spm_client_psa_framework_version(void)
handler for psa_framework_version.
uint32_t tfm_spm_psa_framework_version(void)
SVC handler for psa_framework_version.
#define TFM_HANDLE_STATUS_CONNECT_ERROR
void tfm_event_wake(struct tfm_event_t *pevnt, uint32_t retval)
void tfm_spm_psa_reply(uint32_t *args)
SVC handler for psa_reply.
#define TFM_HANDLE_STATUS_ACTIVE
uint32_t tfm_spm_partition_get_privileged_mode(uint32_t partition_flags)
Get the current partition mode.
struct tfm_spm_service_t service[]
void tfm_spm_psa_panic(void)
Terminate execution within the calling Secure Partition and will not return.
#define PSA_LIFECYCLE_UNKNOWN
psa_outvec outvec[PSA_MAX_IOVEC]
int32_t tfm_spm_set_rhandle(struct tfm_spm_service_t *service, struct tfm_conn_handle_t *conn_handle, void *rhandle)
Set reverse handle value for connection.
#define is_tfm_rpc_msg(x)
psa_status_t tfm_spm_client_psa_call(psa_handle_t handle, int32_t type, const psa_invec *inptr, size_t in_num, psa_outvec *outptr, size_t out_num, bool ns_caller, uint32_t privileged)
handler for psa_call.
uint32_t tfm_spm_get_lifecycle_state(void)
psa_invec invec[PSA_MAX_IOVEC]
void tfm_spm_client_psa_close(psa_handle_t handle, bool ns_caller)
handler for psa_close.
void tfm_core_panic(void)
int32_t tfm_memory_check(const void *buffer, size_t len, bool ns_caller, enum tfm_memory_access_e access, uint32_t privileged)
Check the memory reference is valid.
void tfm_spm_psa_close(uint32_t *args, bool ns_caller)
SVC handler for psa_close.
psa_status_t tfm_spm_psa_get(uint32_t *args)
SVC handler for psa_get.
psa_status_t tfm_spm_psa_call(uint32_t *args, bool ns_caller, uint32_t lr)
SVC handler for psa_call.
struct partition_t * partition
void tfm_spm_psa_write(uint32_t *args)
SVC handler for psa_write.
void tfm_spm_psa_clear(void)
SVC handler for psa_clear.
struct partition_t * tfm_spm_get_running_partition(void)
Get current running partition context.
#define PSA_IPC_DISCONNECT
void tfm_event_wait(struct tfm_event_t *pevnt)
psa_signal_t tfm_spm_psa_wait(uint32_t *args)
Handle signal wait request.
struct tfm_msg_body_t * tfm_spm_get_msg_by_signal(struct partition_t *partition, psa_signal_t signal)
Get the msg context by signal.
void * spm_memcpy(void *dest, const void *src, size_t n)
Memory copy function for TF-M core.
#define PSA_ERROR_PROGRAMMER_ERROR
size_t in_size[PSA_MAX_IOVEC]
struct tfm_spm_service_t * service
#define TFM_CORE_ASSERT(cond)
uint32_t signals_asserted
void tfm_spm_psa_notify(uint32_t *args)
SVC handler for psa_notify.
size_t tfm_spm_psa_read(uint32_t *args)
SVC handler for psa_read.
#define TFM_GET_CONTAINER_PTR(ptr, type, member)
#define PSA_ERROR_CONNECTION_REFUSED
uint32_t tfm_spm_psa_version(uint32_t *args, bool ns_caller)
SVC handler for psa_version.
void notify_with_signal(int32_t partition_id, psa_signal_t signal)
notify the partition with the signal.
#define TFM_HANDLE_STATUS_IDLE
const struct partition_static_t * static_data
#define TFM_CLIENT_ID_IS_NS(client_id)
Checks if the provided client ID is a non-secure client ID.
psa_status_t tfm_spm_client_psa_connect(uint32_t sid, uint32_t version, bool ns_caller)
handler for psa_connect.
size_t out_size[PSA_MAX_IOVEC]
size_t tfm_spm_psa_skip(uint32_t *args)
SVC handler for psa_skip.
int32_t get_irq_line_for_signal(int32_t partition_id, psa_signal_t signal, IRQn_Type *irq_line)
Return the IRQ line number associated with a signal.
struct tfm_event_t ack_evnt
void update_caller_outvec_len(struct tfm_msg_body_t *msg)
uint32_t tfm_spm_client_psa_version(uint32_t sid, bool ns_caller)
handler for psa_version.
struct tfm_msg_body_t * tfm_spm_get_msg_from_handle(psa_handle_t msg_handle)
Get message context by message handle.
#define PSA_ERROR_DOES_NOT_EXIST
int32_t tfm_spm_free_conn_handle(struct tfm_spm_service_t *service, struct tfm_conn_handle_t *conn_handle)
Free connection handle which not used anymore.
int32_t psa_status_t
Function return status.
struct tfm_conn_handle_t * tfm_spm_to_handle_instance(psa_handle_t user_handle)
Converts a user handle into a corresponded handle instance.
bool tfm_is_one_bit_set(uint32_t n)
#define tfm_rpc_client_call_reply(owner, ret)
psa_status_t tfm_spm_psa_connect(uint32_t *args, bool ns_caller)
SVC handler for psa_connect.