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, size_t len);
26 void emb_ts_close(struct ts_store_handle *h);
27 
28 TEE_Result emb_ts_open(const TEE_UUID *uuid,
29 		       struct ts_store_handle **h,
30 		       const struct embedded_ts* (*find_ts)
31 		       (const TEE_UUID *uuid));
32 TEE_Result emb_ts_get_size(const struct ts_store_handle *h, size_t *size);
33 TEE_Result emb_ts_get_tag(const struct ts_store_handle *h,
34 			  uint8_t *tag, unsigned int *tag_len);
35 #endif /* KERNEL_EMBEDDED_TS_H */
36 
37