1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2019-2021, Linaro Limited
4  * Copyright (c) 2020, Arm Limited
5  */
6 
7 #ifndef __KERNEL_USER_MODE_CTX_STRUCT_H
8 #define __KERNEL_USER_MODE_CTX_STRUCT_H
9 
10 #include <kernel/tee_ta_manager.h>
11 #include <kernel/thread.h>
12 #include <mm/tee_mmu_types.h>
13 
14 /*
15  * struct user_mode_ctx - user mode context
16  * @vm_info:		Virtual memory map of this context
17  * @regions:		Memory regions registered by pager
18  * @vfp:		State of VFP registers
19  * @ts_ctx:		Generic TS context
20  * @entry_func:		Entry address in TS
21  * @dump_entry_func:	Entry address in TS for dumping address mappings
22  *			and stack trace
23  * @ftrace_entry_func:	Entry address in ldelf for dumping ftrace data
24  * @dl_entry_func:	Entry address in ldelf for dynamic linking
25  * @ldelf_stack_ptr:	Stack pointer used for dumping address mappings and
26  *			stack trace
27  * @is_32bit:		True if 32-bit TS, false if 64-bit TS
28  * @is_initializing:	True if TS is not fully loaded
29  * @stack_ptr:		Stack pointer
30  */
31 struct user_mode_ctx {
32 	struct vm_info vm_info;
33 	struct vm_paged_region_head *regions;
34 #if defined(CFG_WITH_VFP)
35 	struct thread_user_vfp_state vfp;
36 #endif
37 	struct ts_ctx *ts_ctx;
38 	uaddr_t entry_func;
39 	uaddr_t dump_entry_func;
40 #ifdef CFG_FTRACE_SUPPORT
41 	uaddr_t ftrace_entry_func;
42 #endif
43 	uaddr_t dl_entry_func;
44 	uaddr_t ldelf_stack_ptr;
45 	bool is_32bit;
46 	bool is_initializing;
47 	vaddr_t stack_ptr;
48 };
49 #endif /*__KERNEL_USER_MODE_CTX_STRUCT_H*/
50 
51