1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2017, Linaro Limited 4 * Copyright (c) 2020, Arm Limited. 5 */ 6 #ifndef __KERNEL_EMBEDDED_TS_H 7 #define __KERNEL_EMBEDDED_TS_H 8 9 #include <compiler.h> 10 #include <kernel/linker.h> 11 #include <stdint.h> 12 #include <tee_api_types.h> 13 #include <util.h> 14 15 struct embedded_ts { 16 uint32_t flags; 17 TEE_UUID uuid; 18 uint32_t size; 19 uint32_t uncompressed_size; /* 0: not compressed */ 20 const uint8_t *ts; /* @size bytes */ 21 }; 22 23 struct ts_store_handle; 24 25 TEE_Result emb_ts_read(struct ts_store_handle *h, void *data_core, 26 void *data_user, size_t len); 27 void emb_ts_close(struct ts_store_handle *h); 28 29 TEE_Result emb_ts_open(const TEE_UUID *uuid, 30 struct ts_store_handle **h, 31 const struct embedded_ts* (*find_ts) 32 (const TEE_UUID *uuid)); 33 TEE_Result emb_ts_get_size(const struct ts_store_handle *h, size_t *size); 34 TEE_Result emb_ts_get_tag(const struct ts_store_handle *h, 35 uint8_t *tag, unsigned int *tag_len); 36 #endif /* __KERNEL_EMBEDDED_TS_H */ 37 38