xref: /optee_os/lib/libutee/tee_api_private.h (revision 6915bbbb5b56e147ee652b98f6172f4dfbb325b9)
11bb92983SJerome Forissier /* SPDX-License-Identifier: BSD-2-Clause */
2e86f1266SJens Wiklander /*
3*6915bbbbSJens Wiklander  * Copyright (c) 2015-2020, Linaro Limited
4e86f1266SJens Wiklander  */
5e86f1266SJens Wiklander #ifndef TEE_API_PRIVATE
6e86f1266SJens Wiklander #define TEE_API_PRIVATE
7e86f1266SJens Wiklander 
8e86f1266SJens Wiklander #include <tee_api_types.h>
9e86f1266SJens Wiklander #include <utee_types.h>
10e86f1266SJens Wiklander 
11e86f1266SJens Wiklander 
12e86f1266SJens Wiklander void __utee_from_attr(struct utee_attribute *ua, const TEE_Attribute *attrs,
13e86f1266SJens Wiklander 			uint32_t attr_count);
14e86f1266SJens Wiklander 
15fde3a7f2SSumit Garg TEE_Result __utee_entry(unsigned long func, unsigned long session_id,
162f04385cSJens Wiklander 			struct utee_params *up, unsigned long cmd_id);
17e86f1266SJens Wiklander 
18e86f1266SJens Wiklander 
19883c4be3SJerome Forissier #if defined(CFG_TA_GPROF_SUPPORT)
20883c4be3SJerome Forissier void __utee_gprof_init(void);
21883c4be3SJerome Forissier void __utee_gprof_fini(void);
22883c4be3SJerome Forissier #else
23883c4be3SJerome Forissier static inline void __utee_gprof_init(void) {}
24883c4be3SJerome Forissier static inline void __utee_gprof_fini(void) {}
25883c4be3SJerome Forissier #endif
26883c4be3SJerome Forissier 
27*6915bbbbSJens Wiklander /*
28*6915bbbbSJens Wiklander  * The functions help checking that the pointers comply with the parameters
29*6915bbbbSJens Wiklander  * annotation as described in the spec. Any descrepency results in a panic
30*6915bbbbSJens Wiklander  * of the TA.
31*6915bbbbSJens Wiklander  */
32*6915bbbbSJens Wiklander void __utee_check_out_annotation(void *buf, const size_t len);
33*6915bbbbSJens Wiklander void __utee_check_inout_annotation(void *buf, const size_t len);
34*6915bbbbSJens Wiklander void __utee_check_attr_in_annotation(const TEE_Attribute *attr, size_t count);
35*6915bbbbSJens Wiklander void __utee_check_outbuf_annotation(void *buf, uint32_t *len);
36*6915bbbbSJens Wiklander void __utee_check_instring_annotation(const char *buf);
37*6915bbbbSJens Wiklander void __utee_check_outstring_annotation(char *buf, uint32_t *len);
38e86f1266SJens Wiklander 
39*6915bbbbSJens Wiklander #endif /*TEE_API_PRIVATE*/
40