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  * @keys:		Pointer authentication keys
20  * @ts_ctx:		Generic TS context
21  * @entry_func:		Entry address in TS
22  * @dump_entry_func:	Entry address in TS for dumping address mappings
23  *			and stack trace
24  * @ftrace_entry_func:	Entry address in ldelf for dumping ftrace data
25  * @dl_entry_func:	Entry address in ldelf for dynamic linking
26  * @ldelf_stack_ptr:	Stack pointer used for dumping address mappings and
27  *			stack trace
28  * @is_32bit:		True if 32-bit TS, false if 64-bit TS
29  * @is_initializing:	True if TS is not fully loaded
30  * @stack_ptr:		Stack pointer
31  */
32 struct user_mode_ctx {
33 	struct vm_info vm_info;
34 	struct vm_paged_region_head *regions;
35 	struct pgt_cache pgt_cache;
36 #if defined(CFG_WITH_VFP)
37 	struct thread_user_vfp_state vfp;
38 #endif
39 #if defined(CFG_TA_PAUTH)
40 	struct thread_pauth_keys keys;
41 #endif
42 	struct ts_ctx *ts_ctx;
43 	uaddr_t entry_func;
44 	uaddr_t dump_entry_func;
45 #ifdef CFG_FTRACE_SUPPORT
46 	uaddr_t ftrace_entry_func;
47 #endif
48 	uaddr_t dl_entry_func;
49 	uaddr_t ldelf_stack_ptr;
50 	bool is_32bit;
51 	bool is_initializing;
52 	vaddr_t stack_ptr;
53 };
54 #endif /*__KERNEL_USER_MODE_CTX_STRUCT_H*/
55 
56