Core: Distinguish connection handle types
SPM function direct accesses internal handle type instance,
and expose 'psa_handle_t' to external. Distinguish the internal
and the external connection handle types.
Remove 'tfm_spm_get_service_by_handle' function since we can
directly get service with connection handle.
Remove 'tfm_spm_find_conn_handle_node' function.
Change-Id: I60b481e409f4165ec1bbde97c498ee17d74c5a29
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/secure_fw/spm/spm_api.h b/secure_fw/spm/spm_api.h
index 6dbd12f..6162b2e 100644
--- a/secure_fw/spm/spm_api.h
+++ b/secure_fw/spm/spm_api.h
@@ -490,10 +490,11 @@
* \param[in] service Target service context pointer
* \param[in] client_id Partition ID of the sender of the message
*
- * \retval PSA_NULL_HANDLE Create failed \ref PSA_NULL_HANDLE
- * \retval >0 Service handle created, \ref psa_handle_t
+ * \retval NULL Create failed
+ * \retval "Not NULL" Service handle created
*/
-psa_handle_t tfm_spm_create_conn_handle(struct tfm_spm_service_t *service,
+struct tfm_conn_handle_t *tfm_spm_create_conn_handle(
+ struct tfm_spm_service_t *service,
int32_t client_id);
/**
@@ -505,8 +506,9 @@
* \retval IPC_SUCCESS Success
* \retval IPC_ERROR_GENERIC Invalid handle
*/
-int32_t tfm_spm_validate_conn_handle(psa_handle_t conn_handle,
- int32_t client_id);
+int32_t tfm_spm_validate_conn_handle(
+ const struct tfm_conn_handle_t *conn_handle,
+ int32_t client_id);
/******************** Partition management functions *************************/
@@ -530,19 +532,6 @@
*/
struct tfm_spm_service_t *tfm_spm_get_service_by_sid(uint32_t sid);
-/**
- * \brief Get the service context by connection handle.
- *
- * \param[in] conn_handle Connection handle created by
- * tfm_spm_create_conn_handle()
- *
- * \retval NULL Failed
- * \retval "Not NULL" Target service context pointer,
- * \ref tfm_spm_service_t structures
- */
-struct tfm_spm_service_t *
- tfm_spm_get_service_by_handle(psa_handle_t conn_handle);
-
/************************ Message functions **********************************/
/**
@@ -554,7 +543,7 @@
* \ref msg_body_t structures
*/
struct tfm_msg_body_t *
- tfm_spm_get_msg_buffer_from_conn_handle(psa_handle_t conn_handle);
+ tfm_spm_get_msg_buffer_from_conn_handle(struct tfm_conn_handle_t *conn_handle);
/**
* \brief Fill the message for PSA client call.
@@ -574,7 +563,7 @@
*/
void tfm_spm_fill_msg(struct tfm_msg_body_t *msg,
struct tfm_spm_service_t *service,
- psa_handle_t handle,
+ struct tfm_conn_handle_t *handle,
int32_t type, int32_t client_id,
psa_invec *invec, size_t in_len,
psa_outvec *outvec, size_t out_len,