xref: /optee_os/core/include/kernel/user_mode_ctx.h (revision 5b25c76ac40f830867e3d60800120ffd7874e8dc)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2019, Linaro Limited
4  */
5 
6 #ifndef __KERNEL_USER_MODE_CTX_H
7 #define __KERNEL_USER_MODE_CTX_H
8 
9 #include <assert.h>
10 #include <kernel/user_mode_ctx_struct.h>
11 #include <kernel/user_ta.h>
12 #include <stdbool.h>
13 
14 static inline bool is_user_mode_ctx(struct tee_ta_ctx *ctx)
15 {
16 	return is_user_ta_ctx(ctx);
17 }
18 
19 static inline struct user_mode_ctx *to_user_mode_ctx(struct tee_ta_ctx *ctx)
20 {
21 	assert(is_user_mode_ctx(ctx));
22 	return container_of(ctx, struct user_mode_ctx, ctx);
23 }
24 
25 void user_mode_ctx_print_mappings(struct user_mode_ctx *umctx);
26 
27 #endif /*__KERNEL_USER_MODE_CTX_H*/
28