• 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 DRVMGR_SRC_DRV_PROCESS_MGR_H
13 #define DRVMGR_SRC_DRV_PROCESS_MGR_H
14 #include <stdint.h>
15 #include <tee_defines.h>
16 #include "drv_dyn_conf_mgr.h"
17 #include "task_mgr.h"
18 
19 #define DRV_ELF_NAME_APPEND 4U /* reserved mem for ".elf" string */
20 #define DRV_TAFS_APPEND 6 /* reserved mem for "/tafs/" string */
21 #define DRV_DEFAULT_STACK_SIZE 0x4000
22 #define WAIT_DRV_MSG_MAX_TIME 2000 /* timeout is ms, 2000ms means 2s */
23 
24 struct drv_spawn_param {
25     struct tee_uuid uuid;
26     char drv_name[DRV_NAME_MAX_LEN + DRV_ELF_NAME_APPEND + DRV_TAFS_APPEND];
27     uint32_t thread_limit;
28     uint32_t heap_size;
29     uint32_t stack_size;
30     uint32_t drv_index;
31 };
32 
33 int32_t create_spawn_sync_msg_info(void);
34 
35 void drv_kill_task(uint32_t taskid);
36 
37 void release_driver(struct task_node *node);
38 
39 int32_t spawn_driver_handle(struct task_node *node);
40 
41 int32_t register_base_drv_node(void);
42 #endif
43