no message

Match-id-9045c8bffb1652c56c30f9f44c082330a52ea7db
This commit is contained in:
xxx
2023-03-01 10:31:54 +08:00
committed by xxx
30 changed files with 37 additions and 56 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
*/
#ifndef DRIVER_SRE_MSG_H
#define DRIVER_SRE_MSG_H
#include <msg_ops.h>
#include <ipclib.h>
#ifdef __cplusplus
#if __cplusplus
@@ -12,7 +12,6 @@
#include <stddef.h>
#include <sys/teecall.h>
#include <msg_ops.h>
#include <mem_ops.h>
#include <tee_sharemem.h>
#include <dyn_conf_dispatch_inf.h>
@@ -11,7 +11,6 @@
*/
#include <stddef.h>
#include <msg_ops.h>
#include <tee_config.h>
#include "securec.h"
#include "ta_framework.h"
@@ -10,7 +10,6 @@
* See the Mulan PSL v2 for more details.
*/
#include "gtask_adapt.h"
#include <msg_ops.h>
#include <mem_ops.h>
#include <ipclib_hal.h>
#include "securec.h"
+4 -5
View File
@@ -23,7 +23,6 @@
#include <sys/fileio.h>
#include <sys/hm_priorities.h> // for `HM_PRIO_TEE_*`
#include <hmdrv.h>
#include <msg_ops.h>
#include <spawn_init.h>
#include <get_elf_info.h>
#include <target_type.h>
@@ -156,7 +155,7 @@ static int gt_create_thread(pid_t *pid)
struct global_to_service_thread_msg entry_msg = { { { 0 } } };
uint32_t msg_id;
uint32_t msghandle;
msg_pid_t sender_pid;
taskid_t sender_pid;
uint32_t rc;
uint64_t stack_size;
@@ -212,7 +211,7 @@ static int gt_recycle_thread(uint32_t task_id, uint32_t session_id)
{
struct global_to_service_thread_msg entry_msg = { { { 0 } } };
uint32_t msg_id;
msg_pid_t pid = 0;
taskid_t pid = 0;
uint32_t rc;
if (get_cur_service() == NULL || get_cur_service()->service_thread == 0)
@@ -419,7 +418,7 @@ static int32_t get_elf_path(int32_t bin_type, char *loader_path, uint32_t loader
return 0;
}
static void wait_srvc_thread_message(struct msg_recv_param *msg_recv_p, uint32_t *task_id, msg_pid_t service_thread)
static void wait_srvc_thread_message(struct msg_recv_param *msg_recv_p, uint32_t *task_id, taskid_t service_thread)
{
/*
* wait at Q#1 for ACK message from "worker_thread" created by
@@ -442,7 +441,7 @@ static void wait_srvc_thread_message(struct msg_recv_param *msg_recv_p, uint32_t
static int32_t create_service_thread(const char *elf_path, char **argv, char **env,
const spawn_uuid_t *uuid, uint32_t *puw_pid)
{
msg_pid_t service_thread = 0;
taskid_t service_thread = 0;
uint32_t task_id = 0;
struct msg_recv_param msg_recv_p;
int32_t ret;
@@ -14,7 +14,6 @@
#include <dlist.h>
#include "securec.h"
#include "tee_log.h"
#include "msg_ops.h"
#include "ta_framework.h"
#include "init.h"
#include "initlib.h"
@@ -12,7 +12,6 @@
#include <stddef.h>
#include <mem_ops.h>
#include <msg_ops.h>
#include <dlist.h>
#include "tee_log.h"
#include "tee_mem_mgmt_api.h"
@@ -11,7 +11,6 @@
*/
#include <stddef.h>
#include <msg_ops.h>
#include <dlist.h>
#include "tee_log.h"
#include "tee_mem_mgmt_api.h"
@@ -14,7 +14,6 @@
#define GTASK_TASK_ADAPTOR_H
#include <dlist.h>
#include "msg_ops.h"
#include "tee_internal_api.h"
#include "tee_internal_task_pub.h"
@@ -12,7 +12,6 @@
#include "task_ssa_adaptor.h"
#include <securec.h>
#include "msg_ops.h"
#include "task_adaptor.h"
#include "tee_task_config.h"
#include "tee_ss_agent_api.h"
+1 -1
View File
@@ -120,7 +120,7 @@ static void remove_all_ipc_channel(uint32_t tid, const struct thread_info *pti)
continue;
}
rc = ipc_remove_channel((msg_pid_t)pid_to_taskid(tid, pid), NULL, i, pti->t_channel[i]);
rc = ipc_remove_channel((taskid_t)pid_to_taskid(tid, pid), NULL, i, pti->t_channel[i]);
if (rc != 0)
tloge("remove ipc channel #%d failed: rc=%d\n", i, rc);
}
+3 -3
View File
@@ -55,7 +55,7 @@ static int64_t driver_open_func(const struct tee_drv_param *params)
return -1;
}
msg_pid_t drv_mgr_pid = get_drv_mgr_pid();
taskid_t drv_mgr_pid = get_drv_mgr_pid();
if (taskid_to_pid(drv_mgr_pid) != (taskid_to_pid(params->caller_pid))) {
tloge("caller pid:0x%x cannot call open\n", params->caller_pid);
return -1;
@@ -75,7 +75,7 @@ static int64_t driver_close_func(const struct tee_drv_param *params)
{
uint64_t *args = (uint64_t *)(uintptr_t)params->args;
msg_pid_t drv_mgr_pid = get_drv_mgr_pid();
taskid_t drv_mgr_pid = get_drv_mgr_pid();
if (taskid_to_pid(drv_mgr_pid) != (taskid_to_pid(params->caller_pid))) {
tloge("caller pid:0x%x cannot call close\n", params->caller_pid);
return -1;
@@ -118,7 +118,7 @@ static int32_t driver_general_handle(struct tee_drv_param *params, int64_t *ret_
#ifdef TEE_SUPPORT_DRV_FD_DUMP
static int32_t driver_dump_handle(int64_t *ret_val, const struct tee_drv_param *params)
{
msg_pid_t drv_mgr_pid = get_drv_mgr_pid();
taskid_t drv_mgr_pid = get_drv_mgr_pid();
if (taskid_to_pid(drv_mgr_pid) != (taskid_to_pid(params->caller_pid))) {
tloge("this task not support dump fd\n");
return -1;
@@ -1076,7 +1076,7 @@ int32_t driver_register_cmd_perm(const struct tee_drv_param *params, int64_t *re
return -1;
}
msg_pid_t drv_mgr_pid = get_drv_mgr_pid();
taskid_t drv_mgr_pid = get_drv_mgr_pid();
if (taskid_to_pid(drv_mgr_pid) != (taskid_to_pid(params->caller_pid))) {
tloge("caller pid:0x%x cannot register drv cmd perm\n", params->caller_pid);
return -1;
+3 -3
View File
@@ -28,11 +28,11 @@
#include <rnd_seed.h>
#endif
static msg_pid_t g_drv_mgr_pid;
static taskid_t g_drv_mgr_pid;
static const struct tee_driver_module *g_drv_func = NULL;
static uint32_t g_drv_index;
static int32_t hunt_drv_mgr_pid(msg_pid_t *pid)
static int32_t hunt_drv_mgr_pid(taskid_t *pid)
{
uint32_t ret = ipc_hunt_by_name("drvmgr", pid);
if (ret != 0) {
@@ -43,7 +43,7 @@ static int32_t hunt_drv_mgr_pid(msg_pid_t *pid)
return 0;
}
msg_pid_t get_drv_mgr_pid(void)
taskid_t get_drv_mgr_pid(void)
{
return g_drv_mgr_pid;
}
+2 -2
View File
@@ -14,14 +14,14 @@
#include <stdio.h>
#include <posix_types.h>
#include <msg_ops.h>
#include <spawn_init.h>
#include <tee_driver_module.h>
#include <ipclib.h>
typedef void (*drv_entry_func)(const struct tee_driver_module *drv_func, const char *drv_name,
cref_t channel, const struct env_param *param);
msg_pid_t get_drv_mgr_pid(void);
taskid_t get_drv_mgr_pid(void);
const struct tee_driver_module *get_drv_func(void);
uint32_t get_drv_index(void);
-1
View File
@@ -11,7 +11,6 @@
*/
#include "tee_agent.h"
#include <ipclib.h>
#include <msg_ops.h>
#include <tee_defines.h>
#include <ta_framework.h>
#include <tee_ext_api.h>
+5 -5
View File
@@ -12,7 +12,7 @@
#ifndef IPC_LIB_HAL_H
#define IPC_LIB_HAL_H
#include <msg_ops.h>
#include <ipclib.h>
#define MSG_TYPE_INVALID 0
#define MSG_TYPE_NOTIF 1
@@ -27,18 +27,18 @@ int32_t ipc_create_channel_native(const char *name, cref_t *pch);
uint32_t ipc_send_msg_sync(uint32_t msg_id, uint32_t dest_pid, const void *msgp, uint32_t size);
/* send uw_msg_id use uc_dst_qid channel */
uint32_t ipc_msg_qsend(msg_handle_t uw_msg_handle, uint32_t uw_msg_id, msg_pid_t uw_dst_pid, uint8_t uc_dst_qid);
uint32_t ipc_msg_qsend(msg_handle_t uw_msg_handle, uint32_t uw_msg_id, taskid_t uw_dst_pid, uint8_t uc_dst_qid);
/* send msgp use 0 channel */
uint32_t ipc_msg_snd(uint32_t uw_msg_id, uint32_t uw_dst_pid, const void *msgp, uint16_t size);
uint32_t ipc_msg_rcv(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size);
uint32_t ipc_msg_rcv_safe(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, msg_pid_t wait_sender);
uint32_t ipc_msg_rcv_safe(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, taskid_t wait_sender);
uint32_t ipc_msg_rcv_a(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, msg_pid_t *puw_sender_pid);
uint32_t ipc_msg_rcv_a(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, taskid_t *puw_sender_pid);
uint32_t ipc_msg_q_recv(msg_handle_t *puw_msg_handle, uint32_t *puw_msg_id, msg_pid_t *puw_sender_pid,
uint32_t ipc_msg_q_recv(msg_handle_t *puw_msg_handle, uint32_t *puw_msg_id, taskid_t *puw_sender_pid,
uint8_t uc_recv_qid, uint32_t uw_timeout);
#endif
+12 -12
View File
@@ -26,7 +26,7 @@ struct msg_st {
struct msgsent_st {
cref_t dst_ch;
uint32_t uw_msg_id;
msg_pid_t uw_dst_pid;
taskid_t uw_dst_pid;
const void *msgp;
uint16_t size;
} __attribute__((__packed__));
@@ -38,7 +38,7 @@ struct msgrcv_st {
uint32_t *puw_msg_id;
void *msgp;
uint16_t size;
msg_pid_t *puw_sender_pid;
taskid_t *puw_sender_pid;
} __attribute__((__packed__));
struct notify_st {
@@ -50,8 +50,8 @@ struct reply_msg_st {
uint32_t status;
} __attribute__((__packed__));
static msg_pid_t g_handle = SRE_PID_ERR;
static int32_t global_handle_check(msg_pid_t *puw_dst_pid)
static taskid_t g_handle = SRE_PID_ERR;
static int32_t global_handle_check(taskid_t *puw_dst_pid)
{
if (puw_dst_pid == NULL)
return -EINVAL;
@@ -144,7 +144,7 @@ static uint32_t ipc_msgsnd_core_sync(struct msgsent_st msgsent, msg_handle_t uw_
return 0;
}
uint32_t ipc_msg_snd(uint32_t uw_msg_id, msg_pid_t uw_dst_pid, const void *msgp, uint16_t size)
uint32_t ipc_msg_snd(uint32_t uw_msg_id, taskid_t uw_dst_pid, const void *msgp, uint16_t size)
{
cref_t dst_ch;
struct msgsent_st msgsent;
@@ -174,7 +174,7 @@ uint32_t ipc_msg_snd(uint32_t uw_msg_id, msg_pid_t uw_dst_pid, const void *msgp,
return ipc_msgsnd_core(msgsent, 0);
}
uint32_t ipc_send_msg_sync(uint32_t msg_id, msg_pid_t dest_pid, const void *msgp, uint32_t size)
uint32_t ipc_send_msg_sync(uint32_t msg_id, taskid_t dest_pid, const void *msgp, uint32_t size)
{
cref_t dst_ch;
struct msgsent_st msgsent;
@@ -200,13 +200,13 @@ uint32_t ipc_send_msg_sync(uint32_t msg_id, msg_pid_t dest_pid, const void *msgp
uint32_t ipc_msg_rcv(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size)
{
msg_pid_t sender_pid;
taskid_t sender_pid;
return ipc_msg_rcv_a(uw_timeout, puw_msg_id, msgp, size, &sender_pid);
}
uint32_t ipc_msg_rcv_safe(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, msg_pid_t wait_sender)
uint32_t ipc_msg_rcv_safe(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, taskid_t wait_sender)
{
msg_pid_t sender = SRE_PID_ERR;
taskid_t sender = SRE_PID_ERR;
uint32_t ret = 0;
while (wait_sender != sender) {
@@ -275,7 +275,7 @@ static uint32_t ipc_msgrcv_core(struct msgrcv_st msgrcv, msg_handle_t *puw_msg_h
return 0;
}
uint32_t ipc_msg_rcv_a(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, msg_pid_t *puw_sender_pid)
uint32_t ipc_msg_rcv_a(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, uint16_t size, taskid_t *puw_sender_pid)
{
cref_t ch;
uint32_t ret;
@@ -305,7 +305,7 @@ uint32_t ipc_msg_rcv_a(uint32_t uw_timeout, uint32_t *puw_msg_id, void *msgp, ui
return ret;
}
uint32_t ipc_msg_qsend(msg_handle_t uw_msg_handle, uint32_t uw_msg_id, msg_pid_t uw_dst_pid, uint8_t uc_dst_qid)
uint32_t ipc_msg_qsend(msg_handle_t uw_msg_handle, uint32_t uw_msg_id, taskid_t uw_dst_pid, uint8_t uc_dst_qid)
{
cref_t dst_ch;
struct msgsent_st msgsent;
@@ -334,7 +334,7 @@ uint32_t ipc_msg_qsend(msg_handle_t uw_msg_handle, uint32_t uw_msg_id, msg_pid_t
return ipc_msgsnd_core(msgsent, uw_msg_handle);
}
uint32_t ipc_msg_q_recv(msg_handle_t *puw_msg_handle, uint32_t *puw_msg_id, msg_pid_t *puw_sender_pid,
uint32_t ipc_msg_q_recv(msg_handle_t *puw_msg_handle, uint32_t *puw_msg_id, taskid_t *puw_sender_pid,
uint8_t uc_recv_qid, uint32_t uw_timeout)
{
cref_t ch;
+1 -2
View File
@@ -15,7 +15,6 @@
#include <pthread.h>
#include <securec.h>
#include <inttypes.h>
#include <msg_ops.h>
#include <tee_defines.h>
#include <tee_init.h>
#include <tee_property_inner.h>
@@ -200,7 +199,7 @@ static void msg_rcv_elf(uint32_t timeout, uint32_t *msg_id, void *msgp, uint32_t
* consider add while(1) or TEE_Panic(must success)
* when ipc_msg_snd return is NOT SRE_OK.
*/
static void msg_send_elf(uint32_t msg_id, msg_pid_t dst_pid, const void *msgp, uint32_t size)
static void msg_send_elf(uint32_t msg_id, taskid_t dst_pid, const void *msgp, uint32_t size)
{
uint32_t ret;
@@ -12,7 +12,6 @@
#include "tee_dynamic_srv.h"
#include <sys/mman.h>
#include <msg_ops.h>
#include <mem_ops.h>
#include <spawn_ext.h>
#include <sys/usrsyscall_ext.h>
@@ -15,12 +15,12 @@
#include <mem_page_ops.h>
#include <uidgid.h>
#include <msg_ops.h>
#include "tee_defines.h"
#include "tee_common.h"
#include "tee_time_api.h"
#include "tee_core_api.h"
#include "ipclib.h"
#define TA_SESSION_MAX 8 /* concurrent opened session count */
#define TA_STACK_MAX 5 /* we limit ta memory to heap_size + stack_size * 5 to compatible with the old version */
+1 -1
View File
@@ -13,9 +13,9 @@
#include <securec.h>
#include <pthread.h>
#include <msg_ops.h>
#include "tee_mem_mgmt_api.h"
#include "tee_init.h"
#include <ipclib.h>
#define DRIVER_TAG_MAX_LEN 25
#define DRIVER_TAGS_NUM 40
@@ -13,7 +13,6 @@
#include "tee_core_api.h"
#include <pthread.h>
#include <securec.h>
#include <msg_ops.h>
#include <dlist.h>
#include <mem_ops.h>
#include <ipclib.h>
@@ -342,7 +342,7 @@ void init_non_std_property(char *buff, uint32_t len)
uint32_t i;
uint32_t end_flag = 0;
if (buff == NULL || len > MAX_HM_NOTI_MSG_SIZE) {
if (buff == NULL || len > NOTIFY_MAX_LEN) {
tloge("invalid parameter\n");
return;
}
-1
View File
@@ -26,7 +26,6 @@
#include "huk_derive_takey.h"
#include "huk_get_deviceid.h"
#include "huk_service_msg.h"
#include "msg_ops.h"
#include <ipclib_hal.h>
#include <spawn_ext.h>
+1 -2
View File
@@ -12,7 +12,6 @@
#include <stdio.h>
#include <sys/mman.h>
#include <tee_log.h>
#include <msg_ops.h>
#include <ipclib.h> /* for channel */
#include <hm_thread.h>
#include <sys/hm_priorities.h> /* for `HM_PRIO_TEE_*' */
@@ -216,7 +215,7 @@ static TEE_Result perm_thread_file_create_ipc_channel(cref_t *msghdl, cref_t *na
static void perm_thread_remove_channel(const char *name, cref_t channel)
{
msg_pid_t pid;
taskid_t pid;
pid = get_self_taskid();
if (pid == SRE_PID_ERR) {
@@ -12,7 +12,6 @@
#include "perm_srv_elf_verify_cmd.h"
#include <securec.h>
#include <tee_log.h>
#include <msg_ops.h>
#include <ta_framework.h>
#include "tee_elf_verify.h"
#include "permission_service.h"
@@ -17,7 +17,6 @@
#include <crypto_wrapper.h>
#include <openssl/rsa.h>
#include <openssl/obj_mac.h>
#include <msg_ops.h>
#include <tee_internal_task_pub.h>
#include "tee_crypto_hal.h"
#include "tee_elf_verify.h"
@@ -9,7 +9,6 @@
* PURPOSE.
* See the Mulan PSL v2 for more details.
*/
#include <msg_ops.h>
#include "ta_framework.h"
#include "tee_log.h"
#include "tee_init.h"
@@ -12,7 +12,6 @@
#include <string.h>
#include <sys/mman.h>
#include <mem_ops.h>
#include <msg_ops.h>
#include "ta_framework.h"
#include "tee_log.h"
#include "tee_init.h"