Compare commits

...

4 Commits

Author SHA1 Message Date
openharmony_ci
6997bcf648 !678 fix: 低功耗tick timer休眠时间计算有误
Merge pull request !678 from zhushengle/cherry-pick-1650532074
2022-04-24 10:23:21 +00:00
zhushengle
b65216740a fixed 8550117 from https://gitee.com/zhushengle/kernel_liteos_m/pulls/660
fix: 低功耗tick timer休眠时间计算有误

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I3dfa2a8ec7562a1182dae74cc706c7a660ae867a
2022-04-21 09:07:55 +00:00
openharmony_ci
2d8e86ede0 !667 解决taskCB未定义以及初始化的问题
Merge pull request !667 from 夏不白/cherry-pick-1648781865
2022-04-11 08:36:50 +00:00
xia-bubai
f750154f44 fixed 67b5791 from https://gitee.com/xia-bubai/kernel_liteos_m/pulls/666
Description: add initialize of taskCB in function ArchTskStackInit
IssueNo:https://gitee.com/openharmony/kernel_liteos_m/issues/I50NRJ
Feature or Bugfix: Bugfix

Signed-off-by: xia-bubai <xiacong4@huawei.com>
2022-04-01 02:57:45 +00:00
2 changed files with 7 additions and 6 deletions

View File

@@ -76,6 +76,7 @@ LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
LITE_OS_SEC_TEXT_INIT VOID *ArchTskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack)
{
TaskContext *context = (TaskContext *)((UINTPTR)topStack + stackSize - sizeof(TaskContext));
LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID);
context->r0 = taskID;
context->r1 = 0x01010101L;

View File

@@ -101,7 +101,7 @@ STATIC VOID OsPmTickTimerStart(LosPmCB *pm)
}
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
if (tickTimer->timerStop != NULL) {
if ((tickTimer->timerStop != NULL) && (pm->enterSleepTime != 0)) {
/* Restore the main CPU frequency */
sleepTime = tickTimer->timerCycleGet();
tickTimer->timerStop();
@@ -123,8 +123,9 @@ STATIC VOID OsPmTickTimerStart(LosPmCB *pm)
STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
{
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
UINT64 sleepCycle;
UINT64 realSleepTime = OsSchedGetNextExpireTime(OsGetCurrSchedTimeCycle());
UINT64 sleepCycle, realSleepTime;
UINT64 currTime = OsGetCurrSchedTimeCycle();
UINT64 expireTime = OsSchedGetNextExpireTime(currTime);
#endif
LosPmTickTimer *tickTimer = pm->tickTimer;
@@ -134,10 +135,9 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
if (tickTimer->timerStart != NULL) {
if (realSleepTime == 0) {
return FALSE;
}
LOS_ASSERT(expireTime > currTime);
realSleepTime = expireTime - currTime;
sleepCycle = OS_SYS_CYCLE_TO_NS(realSleepTime, g_sysClock);
sleepCycle = OS_SYS_NS_TO_CYCLE(sleepCycle, tickTimer->freq);