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 APP_LOAD_SRV_SUPPORT_COMMON_H 13 #define APP_LOAD_SRV_SUPPORT_COMMON_H 14 15 #include "tee_elf_verify.h" 16 17 struct image_version_info { 18 uint32_t img_version; 19 TEE_Result (*secure_img_permission_check)(elf_verify_reply *verify_reply); 20 tee_img_type_t (*get_img_type)(const elf_verify_reply *verify_reply, uint32_t img_version); 21 TEE_Result (*get_img_size)(const uint8_t *share_buf, uint32_t buf_len, uint32_t *size); 22 }; 23 24 TEE_Result load_secure_app_image(tee_img_type_t img_type, const elf_verify_reply *verify_reply); 25 TEE_Result tee_secure_img_permission_check(uint32_t img_version, elf_verify_reply *verify_reply); 26 tee_img_type_t tee_secure_get_img_type(const elf_verify_reply *verify_reply, uint32_t img_version); 27 TEE_Result tee_secure_get_img_size(uint32_t img_version, uint8_t *share_buf, uint32_t buf_len, uint32_t *img_size); 28 void set_load_ta_mode_global_ptr(void); 29 elf_image_info *get_img_info_ptr(void); 30 31 #endif