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 GTASK_TEE_TAK_H 13 #define GTASK_TEE_TAK_H 14 #include <stdint.h> 15 #include "ta_framework.h" 16 17 #define NORMAL_FAIL_RET (-1) 18 #define TIMEOUT_FAIL_RET (-2) 19 #define SUCC_RET 0 20 21 #define ARG_NUM 4 22 #define ARGV_SIZE 64 23 #define ARGV0_SIZE 100 24 #define ARGV2_SIZE 8 25 26 struct tsk_init_param { 27 uint16_t task_prior; /* task prior */ 28 uint16_t que_num; /* msg queue number */ 29 uint32_t args[ARG_NUM]; /* param number */ 30 const char *task_name; /* task name */ 31 uint32_t reserved; 32 uint32_t private_data; /* private data of task */ 33 uint32_t usr_space_num; 34 uint64_t perm; /* Permission bit field */ 35 uint32_t srvc_provider_id; /* Service Provider ID */ 36 struct tee_uuid uuid; 37 }; 38 39 struct msg_recv_param { 40 uint32_t msghandle; 41 uint32_t msg_id; 42 }; 43 44 int sre_task_create(const struct tsk_init_param *init_param, uint32_t *task_id); 45 int32_t sre_task_delete_ex(uint32_t uw_task_pid, bool is_service_dead, uint32_t session_id); 46 #endif /* GTASK_TEE_TAK_H */ 47