• 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 
13 #ifndef LIBDRV_DRV_H
14 #define LIBDRV_DRV_H
15 
16 #include <ipclib.h>
17 #include "tee_msg_type.h"
18 #define MAX_ARGS 16
19 
20 #ifndef SYSCALL_DATA_MAX
21 #define SYSCALL_DATA_MAX 512
22 #define SYSCAL_MSG_BUFFER_SIZE 2048
23 #endif
24 
25 struct drv_req_msg_t {
26     msg_header header;
27     uint64_t args[MAX_ARGS];
28     cref_t job_handler;
29     char data[];
30 } __attribute__((__packed__));
31 
32 struct drv_reply_msg_t {
33     msg_header header;
34     uint64_t __rsvd;
35     char rdata[];
36 } __attribute__((__packed__));
37 
38 struct drv_call_params {
39     uint64_t *args;
40     uint32_t *lens;
41     int32_t nr;
42     void *rdata;
43     uint32_t rdata_len;
44 };
45 
46 int32_t drv_init(const char *path);
47 
48 int64_t drv_call_new(const char *name, uint16_t id, uint64_t *args, uint32_t *lens, int32_t nr);
49 
50 #endif /* LIBDRV_DRV_H */
51