1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, STMicroelectronics International N.V.
4  */
5 
6 #ifndef UTEE_TYPES_H
7 #define UTEE_TYPES_H
8 
9 #include <inttypes.h>
10 #include <tee_api_defines.h>
11 
12 enum utee_time_category {
13 	UTEE_TIME_CAT_SYSTEM = 0,
14 	UTEE_TIME_CAT_TA_PERSISTENT,
15 	UTEE_TIME_CAT_REE
16 };
17 
18 enum utee_entry_func {
19 	UTEE_ENTRY_FUNC_OPEN_SESSION = 0,
20 	UTEE_ENTRY_FUNC_CLOSE_SESSION,
21 	UTEE_ENTRY_FUNC_INVOKE_COMMAND,
22 };
23 
24 /*
25  * Cache operation types.
26  * Used when extensions TEE_CacheClean() / TEE_CacheFlush() /
27  * TEE_CacheInvalidate() are used
28  */
29 enum utee_cache_operation {
30 	TEE_CACHECLEAN = 0,
31 	TEE_CACHEFLUSH,
32 	TEE_CACHEINVALIDATE,
33 };
34 
35 struct utee_params {
36 	uint64_t types;
37 	/* vals[n * 2]	   corresponds to either value.a or memref.buffer
38 	 * vals[n * 2 + ]  corresponds to either value.b or memref.size
39 	 * when converting to/from struct tee_ta_param
40 	 */
41 	uint64_t vals[TEE_NUM_PARAMS * 2];
42 };
43 
44 struct utee_attribute {
45 	uint64_t a;	/* also serves as a pointer for references */
46 	uint64_t b;	/* also serves as a length for references */
47 	uint32_t attribute_id;
48 };
49 
50 #endif /* UTEE_TYPES_H */
51