xref: /optee_os/core/kernel/notif.c (revision 2828809ee87773e817c3ca071330131ae9ce66a7)
1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2021, Linaro Limited
4  */
5 
6 #include <kernel/notif.h>
7 #include <kernel/thread.h>
8 #include <optee_rpc_cmd.h>
9 #include <tee_api_types.h>
10 #include <types_ext.h>
11 
12 static TEE_Result notif_rpc(uint32_t func, uint32_t value)
13 {
14 	struct thread_param params = THREAD_PARAM_VALUE(IN, func, value, 0);
15 
16 	return thread_rpc_cmd(OPTEE_RPC_CMD_NOTIFICATION, 1, &params);
17 }
18 
19 TEE_Result notif_wait(uint32_t value)
20 {
21 	return notif_rpc(OPTEE_RPC_NOTIFICATION_WAIT, value);
22 }
23 
24 TEE_Result notif_send_sync(uint32_t value)
25 {
26 	return notif_rpc(OPTEE_RPC_NOTIFICATION_SEND, value);
27 }
28