fix: 在内核初始化前期启动tick timer
解决系统未初始化完成前无timer可用的问题。 Close #I410F0 Signed-off-by: zhushengle <zhushengle@huawei.com> Change-Id: I3799b9b0ff03cb1dfe80a97816a484df28ae49fd
This commit is contained in:
parent
f2466c4165
commit
b3841ed1dd
|
@ -46,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -116,14 +122,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
value &= ~(OS_TIMER_32K_CLK_BIT);
|
||||
WRITE_UINT32(value, OS_TIMER_CLK_PWD_ADDR);
|
||||
|
||||
value = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
value = LOSCFG_BASE_CORE_TICK_RESPONSE_MAX;
|
||||
WRITE_UINT32(value, OS_TIMER_PERIOD_REG_ADDR);
|
||||
|
||||
READ_UINT32(value, OS_TIMER_CTL_REG_ADDR);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -46,9 +47,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -147,13 +154,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -66,7 +66,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -146,13 +153,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -150,13 +157,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,16 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -146,13 +154,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -146,13 +153,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -150,13 +157,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_timer.h"
|
||||
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -47,9 +47,16 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -148,13 +155,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -66,7 +66,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -47,9 +48,16 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -148,13 +156,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -66,7 +66,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -146,13 +153,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_arch_timer.h"
|
||||
#include "los_debug.h"
|
||||
|
||||
/* ****************************************************************************
|
||||
Function : HalArchInit
|
||||
|
@ -45,9 +46,15 @@
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit()
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************
|
||||
|
@ -146,13 +153,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -65,7 +65,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER *handler)
|
|||
g_sysClock = OS_SYS_CLOCK;
|
||||
g_cyclesPerTick = OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
|
||||
ret = SysTick_Config(g_cyclesPerTick);
|
||||
ret = SysTick_Config(LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
if (ret == 1) {
|
||||
return LOS_ERRNO_TICK_PER_SEC_TOO_SMALL;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#define _LOS_ARCH_H
|
||||
|
||||
#include "los_config.h"
|
||||
#include "los_compiler.h"
|
||||
#include "los_timer.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
|
|
@ -105,7 +105,7 @@ LITE_OS_SEC_TEXT_MINOR NORETURN VOID HalSysExit(VOID);
|
|||
extern VOID HalTaskSchedule(VOID);
|
||||
|
||||
typedef VOID (*OS_TICK_HANDLER)(VOID);
|
||||
UINT32 HalStartSchedule(OS_TICK_HANDLER handler);
|
||||
UINT32 HalStartSchedule(VOID);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "los_timer.h"
|
||||
#include "los_sched.h"
|
||||
#include "los_interrupt.h"
|
||||
#include "los_debug.h"
|
||||
#include "nuclei_sdk_soc.h"
|
||||
|
||||
extern VOID HalHwiInit(VOID);
|
||||
|
@ -40,7 +41,14 @@ extern "C" {
|
|||
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalSysExit(VOID)
|
||||
|
@ -77,16 +85,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
}
|
||||
|
||||
extern LosTask g_losTask;
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
|
||||
(VOID)LOS_IntLock();
|
||||
ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -36,14 +36,21 @@
|
|||
#include "los_sched.h"
|
||||
#include "los_memory.h"
|
||||
#include "los_timer.h"
|
||||
#include "los_debug.h"
|
||||
#include "soc.h"
|
||||
|
||||
|
||||
STATIC UINT32 g_sysNeedSched = FALSE;
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT VOID HalArchInit(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
HalHwiInit();
|
||||
|
||||
ret = HalTickStart(OsTickHandler);
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("Tick start failed!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
VOID HalIrqEndCheckNeedSched(VOID)
|
||||
|
@ -129,14 +136,9 @@ LITE_OS_SEC_TEXT_INIT VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOI
|
|||
return (VOID *)context;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(OS_TICK_HANDLER handler)
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 HalStartSchedule(VOID)
|
||||
{
|
||||
(VOID)LOS_IntLock();
|
||||
UINT32 ret = HalTickStart(handler);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
OsSchedStart();
|
||||
HalStartToRun();
|
||||
return LOS_OK; /* never return */
|
||||
|
|
|
@ -45,7 +45,7 @@ WEAK UINT32 HalTickStart(OS_TICK_HANDLER handler)
|
|||
g_cyclesPerTick = g_sysClock / LOSCFG_BASE_CORE_TICK_PER_SECOND;
|
||||
g_intCount = 0;
|
||||
|
||||
HalClockInit(handler, g_cyclesPerTick);
|
||||
HalClockInit(handler, LOSCFG_BASE_CORE_TICK_RESPONSE_MAX);
|
||||
|
||||
return LOS_OK; /* never return */
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ LITE_OS_SEC_TEXT_INIT static VOID OsRegister(VOID)
|
|||
|
||||
LITE_OS_SEC_TEXT_INIT UINT32 LOS_Start(VOID)
|
||||
{
|
||||
return HalStartSchedule(OsTickHandler);
|
||||
return HalStartSchedule();
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -91,10 +91,6 @@ VOID OsSchedTimerBaseReset(UINT64 currTime)
|
|||
|
||||
UINT64 OsGetCurrSchedTimeCycle(VOID)
|
||||
{
|
||||
if (!g_taskScheduled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 1)
|
||||
return HalGetTickCycle(NULL);
|
||||
#else
|
||||
|
@ -527,7 +523,9 @@ VOID LOS_SchedTickHandler(VOID)
|
|||
UINT64 currTime;
|
||||
BOOL needSched = FALSE;
|
||||
|
||||
LOS_ASSERT(g_taskScheduled);
|
||||
if (!g_taskScheduled) {
|
||||
return;
|
||||
}
|
||||
|
||||
UINT32 intSave = LOS_IntLock();
|
||||
|
||||
|
|
Loading…
Reference in New Issue