diff --git a/kernel/base/include/los_task_pri.h b/kernel/base/include/los_task_pri.h index a4fdf7d3ab095aa5089de16023700f0d8d5dd297..778f9c00201a2e41ddc0050d545ee6d3345f91b5 100644 --- a/kernel/base/include/los_task_pri.h +++ b/kernel/base/include/los_task_pri.h @@ -470,6 +470,15 @@ STATIC INLINE BOOL OsTaskIsPending(const LosTaskCB *taskCB) return FALSE; } +STATIC INLINE BOOL OsTaskIsKilled(const LosTaskCB *taskCB) +{ + if (taskCB->taskStatus & OS_TASK_FLAG_EXIT_KILL) { + return TRUE; + } + + return FALSE; +} + #define OS_TID_CHECK_INVALID(taskID) ((UINT32)(taskID) >= g_taskMaxNum) /* get task info */ diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index 6788815a2add95ea9a859eb36630c6515099027e..fc45bd7d5e90ff230b14d48cda6a673ab30d0b99 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -108,6 +108,7 @@ typedef enum { READ, READ_DROP, READ_TIMEOUT, + KILL, OPERATION_NUM } IpcOpertion; @@ -1099,6 +1100,14 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) return -ETIME; } + if (OsTaskIsKilled(tcb)) { +#if (LOSCFG_KERNEL_TRACE == YES) + IpcTrace(NULL, KILL, tcb->ipcStatus, syncFlag ? MT_REPLY : MT_REQUEST); +#endif + SCHEDULER_UNLOCK(intSave); + return -ERFKILL; + } + SCHEDULER_UNLOCK(intSave); } else { listNode = LOS_DL_LIST_FIRST(listHead); @@ -1178,7 +1187,7 @@ BUFFER_FREE: if ((content->flag & RECV) == RECV) { ret = LiteIpcRead(content); if (ret != LOS_OK) { - PRINT_ERR("LiteIpcRead failed\n"); + PRINT_ERR("LiteIpcRead failed ERROR: %d\n", (INT32)ret); return ret; } UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg);