1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef __SSA_HELPER_H_ 13 #define __SSA_HELPER_H_ 14 15 #include <tee_defines.h> 16 #include "sfs.h" 17 #include "tee_ss_agent_api.h" 18 #include "sfs_internal.h" 19 20 TEE_Result ssa_internal_fcreate(const char *file_name, const TEE_UUID *uuid, struct sfd_t **sfd); 21 TEE_Result ssa_internal_fopen(const char *file_name, const TEE_UUID *uuid, struct sfd_t **sfd); 22 uint32_t ssa_internal_fwrite(struct sfd_t *sfd, const uint8_t *in_buff, uint32_t len); 23 void ssa_internal_fclose(struct sfd_t *sfd); 24 void ssa_internal_fremove(struct sfd_t *sfd); 25 TEE_Result create_param_mapping(const union ssa_agent_msg *msg, uint32_t sndr, mem_map_info_t *obj_id_info, 26 mem_map_info_t *attributes_info, mem_map_info_t *initial_data); 27 void create_param_unmapping(const mem_map_info_t *obj_id_info, const mem_map_info_t *attributes_info, 28 const mem_map_info_t *initial_data); 29 void create_object_proc(const struct create_obj_msg_t *create_obj, uint32_t sndr, 30 const TEE_UUID *uuid, struct ssa_agent_rsp *rsp); 31 TEE_Result open_param_mapping(const union ssa_agent_msg *msg, uint32_t sndr, mem_map_info_t *obj_id_info, 32 mem_map_info_t *attributes_info); 33 void open_param_unmapping(const mem_map_info_t *obj_id_info, const mem_map_info_t *attributes_info); 34 #endif 35