diff --git a/kernel/base/include/los_task_pri.h b/kernel/base/include/los_task_pri.h index f98b047f..76fd942c 100644 --- a/kernel/base/include/los_task_pri.h +++ b/kernel/base/include/los_task_pri.h @@ -359,7 +359,6 @@ typedef struct { UINT16 waitFlag; /**< The type of child process that is waiting, belonging to a group or parent, a specific child process, or any child process */ #ifdef LOSCFG_KERNEL_LITEIPC - UINT32 ipcStatus; LOS_DL_LIST msgListHead; BOOL accessMap[LOSCFG_BASE_CORE_TSK_LIMIT]; #endif diff --git a/kernel/base/ipc/los_signal.c b/kernel/base/ipc/los_signal.c index a4066845..fd5f5817 100644 --- a/kernel/base/ipc/los_signal.c +++ b/kernel/base/ipc/los_signal.c @@ -157,13 +157,10 @@ STATIC UINT32 OsPendingTaskWake(LosTaskCB *taskCB, INT32 signo) case OS_TASK_WAIT_SIGNAL: OsSigWaitTaskWake(taskCB, signo); break; -#ifdef LOSCFG_KERNEL_LITEIPC case OS_TASK_WAIT_LITEIPC: - taskCB->ipcStatus &= ~IPC_THREAD_STATUS_PEND; OsTaskWakeClearPendMask(taskCB); OsSchedTaskWake(taskCB); break; -#endif case OS_TASK_WAIT_FUTEX: OsFutexNodeDeleteFromFutexHash(&taskCB->futex, TRUE, NULL, NULL); OsTaskWakeClearPendMask(taskCB); diff --git a/kernel/base/sched/sched_sq/los_sched.c b/kernel/base/sched/sched_sq/los_sched.c index dab0291c..d2c8425e 100644 --- a/kernel/base/sched/sched_sq/los_sched.c +++ b/kernel/base/sched/sched_sq/los_sched.c @@ -472,9 +472,6 @@ STATIC INLINE VOID OsSchedWakePendTimeTask(UINT64 currTime, LosTaskCB *taskCB, B if (tempStatus & (OS_TASK_STATUS_PENDING | OS_TASK_STATUS_DELAY)) { taskCB->taskStatus &= ~(OS_TASK_STATUS_PENDING | OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY); if (tempStatus & OS_TASK_STATUS_PENDING) { -#ifdef LOSCFG_KERNEL_LITEIPC - taskCB->ipcStatus &= ~IPC_THREAD_STATUS_PEND; -#endif taskCB->taskStatus |= OS_TASK_STATUS_TIMEOUT; LOS_ListDelete(&taskCB->pendList); taskCB->taskMux = NULL; diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index f23c6894..f12857f4 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -953,9 +953,8 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcWrite(IpcContent *content) SCHEDULER_LOCK(intSave); LosTaskCB *tcb = OS_TCB_FROM_TID(dstTid); LOS_ListTailInsert(&(tcb->msgListHead), &(buf->listNode)); - OsHookCall(LOS_HOOK_TYPE_IPC_WRITE, &buf->msg, dstTid, tcb->processID, tcb->ipcStatus); - if (tcb->ipcStatus & IPC_THREAD_STATUS_PEND) { - tcb->ipcStatus &= ~IPC_THREAD_STATUS_PEND; + OsHookCall(LOS_HOOK_TYPE_IPC_WRITE, &buf->msg, dstTid, tcb->processID, tcb->waitFlag); + if (tcb->waitFlag == OS_TASK_WAIT_LITEIPC) { OsTaskWakeClearPendMask(tcb); OsSchedTaskWake(tcb); SCHEDULER_UNLOCK(intSave); @@ -1011,11 +1010,11 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c ret = -EINVAL; } if (ret != LOS_OK) { - OsHookCall(LOS_HOOK_TYPE_IPC_READ_DROP, &node->msg, tcb->ipcStatus); + OsHookCall(LOS_HOOK_TYPE_IPC_READ_DROP, &node->msg, tcb->waitFlag); (VOID)HandleSpecialObjects(LOS_CurTaskIDGet(), node, TRUE); (VOID)LiteIpcNodeFree(LOS_GetCurrProcessID(), (VOID *)node); } else { - OsHookCall(LOS_HOOK_TYPE_IPC_READ, &node->msg, tcb->ipcStatus); + OsHookCall(LOS_HOOK_TYPE_IPC_READ, &node->msg, tcb->waitFlag); } return ret; } @@ -1035,18 +1034,17 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) do { SCHEDULER_LOCK(intSave); if (LOS_ListEmpty(listHead)) { - OsHookCall(LOS_HOOK_TYPE_IPC_TRY_READ, syncFlag ? MT_REPLY : MT_REQUEST, tcb->ipcStatus); - tcb->ipcStatus |= IPC_THREAD_STATUS_PEND; OsTaskWaitSetPendMask(OS_TASK_WAIT_LITEIPC, OS_INVALID_VALUE, timeout); + OsHookCall(LOS_HOOK_TYPE_IPC_TRY_READ, syncFlag ? MT_REPLY : MT_REQUEST, tcb->waitFlag); ret = OsSchedTaskWait(&g_ipcPendlist, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { - OsHookCall(LOS_HOOK_TYPE_IPC_READ_TIMEOUT, syncFlag ? MT_REPLY : MT_REQUEST, tcb->ipcStatus); + OsHookCall(LOS_HOOK_TYPE_IPC_READ_TIMEOUT, syncFlag ? MT_REPLY : MT_REQUEST, tcb->waitFlag); SCHEDULER_UNLOCK(intSave); return -ETIME; } if (OsTaskIsKilled(tcb)) { - OsHookCall(LOS_HOOK_TYPE_IPC_KILL, syncFlag ? MT_REPLY : MT_REQUEST, tcb->ipcStatus); + OsHookCall(LOS_HOOK_TYPE_IPC_KILL, syncFlag ? MT_REPLY : MT_REQUEST, tcb->waitFlag); SCHEDULER_UNLOCK(intSave); return -ERFKILL; } diff --git a/kernel/extended/liteipc/hm_liteipc.h b/kernel/extended/liteipc/hm_liteipc.h index a7d46cf1..ddc1a976 100644 --- a/kernel/extended/liteipc/hm_liteipc.h +++ b/kernel/extended/liteipc/hm_liteipc.h @@ -169,11 +169,6 @@ typedef struct { VOID *buffToFree; } IpcContent; -#define IPC_THREAD_STATUS_INVAL 0x0001U -#define IPC_THREAD_STATUS_START 0x0002U -#define IPC_THREAD_STATUS_PEND 0x0004U -#define IPC_THREAD_STATUS_STOP 0x0008U - /* init liteipc driver */ extern UINT32 OsLiteIpcInit(VOID);