xref: /optee_os/core/include/kernel/ts_manager.h (revision 00b3b9a25e768c935ac2ed2fa8f50157390e7204)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, STMicroelectronics International N.V.
4  * Copyright (c) 2017-2020, Linaro Limited
5  */
6 
7 #ifndef __KERNEL_TS_MANAGER_H
8 #define __KERNEL_TS_MANAGER_H
9 
10 #include <sys/queue.h>
11 
12 struct ts_session {
13 	TAILQ_ENTRY(ts_session) link_tsd;
14 	struct tee_ta_ctx *ctx;	/* TA context */
15 #if defined(CFG_TA_GPROF_SUPPORT)
16 	struct sample_buf *sbuf; /* Profiling data (PC sampling) */
17 #endif
18 #if defined(CFG_FTRACE_SUPPORT)
19 	struct ftrace_buf *fbuf; /* ftrace buffer */
20 #endif
21 };
22 
23 struct ts_session *ts_get_current_session(void);
24 struct ts_session *ts_get_current_session_may_fail(void);
25 
26 void ts_push_current_session(struct ts_session *sess);
27 struct ts_session *ts_pop_current_session(void);
28 struct ts_session *ts_get_calling_session(void);
29 
30 #endif /*__KERNEL_TS_MANAGER_H*/
31