feat: 同步调度部分优化至liteos_m

1.tick timer与调度进一步剥离
2.性能敏感函数内敛化

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I00c27216e286dd7ca9c02db3e2377707d628a786
This commit is contained in:
zhushengle
2022-02-10 20:43:54 +08:00
parent d1d412255c
commit fb11ab181e
25 changed files with 253 additions and 221 deletions

View File

@@ -31,8 +31,11 @@
#include "los_pm.h"
#include "securec.h"
#include "los_sched.h"
#include "los_timer.h"
#include "los_task.h"
#include "los_tick.h"
#include "los_event.h"
#include "los_sched.h"
#include "los_memory.h"
#include "los_swtmr.h"
@@ -70,7 +73,6 @@ typedef struct {
STATIC EVENT_CB_S g_pmEvent;
STATIC LosPmCB g_pmCB;
STATIC LosPmSysctrl g_sysctrl;
STATIC UINT64 g_pmSleepTime;
STATIC VOID OsPmSysctrlInit(VOID)
{
@@ -122,7 +124,7 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
{
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
UINT64 sleepCycle;
UINT64 realSleepTime = g_pmSleepTime;
UINT64 realSleepTime = OsSchedGetNextExpireTime(OsGetCurrSchedTimeCycle());
#endif
LosPmTickTimer *tickTimer = pm->tickTimer;
@@ -239,7 +241,6 @@ STATIC UINT32 OsPmSuspendSleep(LosPmCB *pm)
LOS_SysSleepEnum mode;
UINT32 prepare = 0;
BOOL tickTimerStop = FALSE;
UINT64 currTime;
ret = OsPmSuspendCheck(pm, &sysSuspendEarly, &deviceSuspend, &mode);
if (ret != LOS_OK) {
@@ -261,9 +262,8 @@ STATIC UINT32 OsPmSuspendSleep(LosPmCB *pm)
tickTimerStop = OsPmTickTimerStop(pm);
if (!tickTimerStop) {
currTime = OsGetCurrSchedTimeCycle();
OsSchedResetSchedResponseTime(0);
OsSchedUpdateExpireTime(currTime);
OsSchedUpdateExpireTime();
}
OsPmCpuSuspend(pm);
@@ -723,11 +723,6 @@ UINT32 LOS_PmSuspend(UINT32 wakeCount)
return OsPmSuspendSleep(&g_pmCB);
}
STATIC VOID OsPmSleepTimeSet(UINT64 sleepTime)
{
g_pmSleepTime = sleepTime;
}
BOOL OsIsPmMode(VOID)
{
LosPmCB *pm = &g_pmCB;
@@ -752,11 +747,6 @@ UINT32 OsPmInit(VOID)
LOS_ListInit(&pm->lockList);
(VOID)LOS_EventInit(&g_pmEvent);
ret = OsSchedRealSleepTimeSet(OsPmSleepTimeSet);
if (ret != LOS_OK) {
return ret;
}
ret = OsPmEnterHandlerSet(OsPmNormalSleep);
if (ret != LOS_OK) {
return ret;