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 TEE_SHAREMEM_H 13 #define TEE_SHAREMEM_H 14 15 #include <stdint.h> 16 17 #define MAX_TAG_LEN 32 18 #define CHIP_TYPE_LEN_MAX 32 19 20 /* 21 * when clear_flag is true, sharedmem buffer will be memset to zero 22 * after sharedmem acquired firstly 23 */ 24 int32_t get_tlv_sharedmem(const char *type, uint32_t type_size, 25 void *buffer, uint32_t *size, bool clear_flag); 26 int32_t tee_get_chip_type(char *buffer, uint32_t buffer_len); 27 28 int32_t tee_shared_mem(const char *type, uint32_t type_size, void *buffer, uint32_t *buffer_size, bool clear_flag); 29 int32_t tee_get_oemkey_info(uint8_t *oem_key, size_t key_size); 30 31 /** 32 * @brief get advanced security mode 33 * 34 * @param advsecmode [OUT] 0:no advanced security mode; none-zero:level of security mode. 35 * 36 * @return TEE_SUCCESS means success, others means failed. 37 * @since 20 38 * @version 1.0 39 */ 40 int32_t tee_ext_get_advsecmode(uint32_t *advsecmode); 41 42 #endif 43