• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3  * Licensed under the Mulan PSL v2.
4  * You can use this software according to the terms and conditions of the Mulan PSL v2.
5  * You may obtain a copy of Mulan PSL v2 at:
6  *     http://license.coscl.org.cn/MulanPSL2
7  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8  * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9  * PURPOSE.
10  * See the Mulan PSL v2 for more details.
11  */
12 #ifndef _TEE_SERVICE_PUBLIC_H_
13 #define _TEE_SERVICE_PUBLIC_H_
14 
15 typedef void (*func_ptr)(void);
16 
17 #include "tee_defines.h"
18 
19 /* don't allow to edit these files */
20 #define TEE_SERVICE_MSG_QUEUE_SIZE 100
21 typedef struct {
22     uint64_t arg0;
23     uint64_t arg1;
24     uint64_t arg2;
25     uint64_t arg3;
26     uint64_t arg4;
27     uint64_t arg5;
28     uint64_t arg6;
29     uint64_t arg7;
30 } args_t;
31 
32 struct reg_ta_info {
33     uint32_t taskid;
34     TEE_UUID uuid;
35     uint32_t userid;
36     bool ssa_enum_enable; /* just for ssa, other tasks will ignore it */
37 };
38 
39 typedef union {
40     args_t args_data;
41     struct reg_ta_info reg_ta;
42 } tee_service_ipc_msg;
43 
44 struct tee_service_ipc_msg_req {
45     uint32_t cmd;
46     tee_service_ipc_msg msg;
47 };
48 
49 typedef struct {
50     TEE_Result ret;
51     tee_service_ipc_msg msg;
52 } tee_service_ipc_msg_rsp;
53 
54 typedef struct {
55     uint32_t msg_id;
56     uint32_t sender;
57     tee_service_ipc_msg msg;
58 } tee_service_msg_t;
59 typedef struct {
60     uint32_t in;
61     uint32_t out;
62     tee_service_msg_t msg[TEE_SERVICE_MSG_QUEUE_SIZE];
63 } tee_service_msg_queue_t;
64 
65 void tee_common_ipc_proc_cmd(const char *task_name,
66                              uint32_t snd_cmd, const tee_service_ipc_msg *snd_msg,
67                              uint32_t ack_cmd, tee_service_ipc_msg_rsp *rsp_msg);
68 #endif
69