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_AGENT_MANAGER_H 13 #define GTASK_AGENT_MANAGER_H 14 15 #include <dlist.h> 16 #include "gtask_core.h" 17 18 TEE_Result register_agent(const smc_cmd_t *cmd); 19 TEE_Result unregister_agent(const smc_cmd_t *cmd); 20 TEE_Result agent_late_init(const smc_cmd_t *cmd); 21 TEE_Result tee_get_agent_buffer(uint32_t agent_id, paddr_t *buffer, uint32_t *length); 22 void tee_unlock_agents(struct session_struct *session); 23 void agent_manager_init(void); 24 void register_agent_buffer_to_task(uint32_t agent_id, uint32_t dest_task_id); 25 TEE_Result set_service_thread_cmd(const smc_cmd_t *cmd, bool *async); 26 bool service_thread_request_dequeue(const smc_cmd_t *in, smc_cmd_t *out); 27 28 int32_t handle_agent_request(uint32_t cmd_id, uint32_t task_id, 29 const uint8_t *msg_buf, uint32_t msg_size); 30 int32_t handle_service_agent_back_cmd(const smc_cmd_t *cmd); 31 int32_t handle_ta_agent_back_cmd(smc_cmd_t *cmd); 32 33 #endif /* GTASK_AGENT_MANAGER_H */ 34