IssueNo:#I3IK07
Description:liteos_m scheduling optimization and low power design. Sig:kernel Feature or Bugfix:Feature Binary Source:No Change-Id: If913b673c9b69039b51ca416be0a77ebccf2773b
This commit is contained in:
14
kernel/src/los_queue.c
Executable file → Normal file
14
kernel/src/los_queue.c
Executable file → Normal file
@@ -38,6 +38,7 @@
|
||||
#include "los_membox.h"
|
||||
#include "los_memory.h"
|
||||
#include "los_task.h"
|
||||
#include "los_sched.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
@@ -281,7 +282,6 @@ static INLINE UINT32 OsQueueOperateParamCheck(const LosQueueCB *queueCB, UINT32
|
||||
UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT32 *bufferSize, UINT32 timeOut)
|
||||
{
|
||||
LosQueueCB *queueCB = NULL;
|
||||
LosTaskCB *runTsk = NULL;
|
||||
LosTaskCB *resumedTask = NULL;
|
||||
UINT32 ret;
|
||||
UINT32 readWrite = OS_QUEUE_READ_WRITE_GET(operateType);
|
||||
@@ -306,14 +306,14 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT
|
||||
goto QUEUE_END;
|
||||
}
|
||||
|
||||
runTsk = (LosTaskCB *)g_losTask.runTask;
|
||||
OsTaskWait(&queueCB->readWriteList[readWrite], OS_TASK_STATUS_PEND_QUEUE, timeOut);
|
||||
LosTaskCB *runTsk = (LosTaskCB *)g_losTask.runTask;
|
||||
OsSchedTaskWait(&queueCB->readWriteList[readWrite], timeOut);
|
||||
LOS_IntRestore(intSave);
|
||||
LOS_Schedule();
|
||||
|
||||
intSave = LOS_IntLock();
|
||||
if (runTsk->taskStatus & OS_TASK_STATUS_TIMEOUT) {
|
||||
runTsk->taskStatus &= (~OS_TASK_STATUS_TIMEOUT);
|
||||
runTsk->taskStatus &= ~OS_TASK_STATUS_TIMEOUT;
|
||||
ret = LOS_ERRNO_QUEUE_TIMEOUT;
|
||||
goto QUEUE_END;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT
|
||||
|
||||
if (!LOS_ListEmpty(&queueCB->readWriteList[readWriteTmp])) {
|
||||
resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->readWriteList[readWriteTmp]));
|
||||
OsTaskWake(resumedTask, OS_TASK_STATUS_PEND_QUEUE);
|
||||
OsSchedTaskWake(resumedTask);
|
||||
LOS_IntRestore(intSave);
|
||||
LOS_Schedule();
|
||||
return LOS_OK;
|
||||
@@ -484,7 +484,7 @@ LITE_OS_SEC_TEXT VOID *OsQueueMailAlloc(UINT32 queueID, VOID *mailPool, UINT32 t
|
||||
}
|
||||
|
||||
runTsk = (LosTaskCB *)g_losTask.runTask;
|
||||
OsTaskWait(&queueCB->memList, OS_TASK_STATUS_PEND_QUEUE, timeOut);
|
||||
OsSchedTaskWait(&queueCB->memList, timeOut);
|
||||
LOS_IntRestore(intSave);
|
||||
LOS_Schedule();
|
||||
|
||||
@@ -545,7 +545,7 @@ LITE_OS_SEC_TEXT UINT32 OsQueueMailFree(UINT32 queueID, VOID *mailPool, VOID *ma
|
||||
|
||||
if (!LOS_ListEmpty(&queueCB->memList)) {
|
||||
resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->memList));
|
||||
OsTaskWake(resumedTask, OS_TASK_STATUS_PEND_QUEUE);
|
||||
OsSchedTaskWake(resumedTask);
|
||||
mem = LOS_MemboxAlloc(mailPool);
|
||||
if (mem == NULL) {
|
||||
LOS_IntRestore(intSave);
|
||||
|
||||
Reference in New Issue
Block a user