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 13 #ifndef GTASK_TEE_LOAD_LIB_H 14 #define GTASK_TEE_LOAD_LIB_H 15 #include "gtask_core.h" 16 17 extern struct service_struct *g_cur_service; 18 extern struct session_struct *g_cur_session; 19 20 #define CHECK_ERROR (-1) 21 #define LIB_LOADED 1 22 #define LIB_NOT_LOADED 0 23 24 TEE_Result process_close_session_entry(struct service_struct **service, struct session_struct **session); 25 void tee_delete_all_libinfo(struct service_struct *service); 26 TEE_Result tee_add_libinfo(struct service_struct *service, const char *name, size_t name_size, 27 tee_img_type_t type); 28 int is_lib_loaded(const struct service_struct *service, const char *name, size_t name_size); 29 void do_age_timeout_lib(struct service_struct *service); 30 int32_t handle_unlink_dynamic_drv(uint32_t cmd_id, uint32_t task_id, const uint8_t *msg_buf, uint32_t msg_size); 31 #endif 32