@@ -641,10 +641,34 @@ extern UINT8 *m_aucSysMem0;
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* When the tick timer is a non-64/128-bit timer, it has ultra-low power compensation.
|
||||
* Configuration item for low power frame tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_BASE_CORE_SCHED_SLEEP
|
||||
#define LOSCFG_BASE_CORE_SCHED_SLEEP 0
|
||||
#ifndef LOSCFG_KERNEL_PM
|
||||
#define LOSCFG_KERNEL_PM 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for priority of low-power task.
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_PM_TASK_PTIORITY
|
||||
#define LOSCFG_KERNEL_PM_TASK_PTIORITY 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for stack size of low-power task.
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_PM_TASK_STACKSIZE
|
||||
#define LOSCFG_KERNEL_PM_TASK_STACKSIZE 0x800
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_config
|
||||
* Configuration item for low power frame debug tailoring
|
||||
*/
|
||||
#ifndef LOSCFG_KERNEL_PM_DEBUG
|
||||
#define LOSCFG_KERNEL_PM_DEBUG 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,7 +55,7 @@ VOID OsSchedSetIdleTaskSchedParam(LosTaskCB *idleTask);
|
||||
|
||||
UINT32 OsSchedSwtmrScanRegister(SchedScan func);
|
||||
|
||||
VOID OsSchedUpdateExpireTime(UINT64 startTime);
|
||||
VOID OsSchedUpdateExpireTime(UINT64 startTime, BOOL timeUpdate);
|
||||
|
||||
VOID OsSchedTaskDeQueue(LosTaskCB *taskCB);
|
||||
|
||||
@@ -83,27 +83,64 @@ BOOL OsSchedTaskSwitch(VOID);
|
||||
|
||||
LosTaskCB *OsGetTopTask(VOID);
|
||||
|
||||
UINT32 OsSchedRealSleepTimeSet(VOID (*func)(UINT64));
|
||||
|
||||
VOID OsSchedTimerBaseReset(UINT64 currTime);
|
||||
|
||||
/**
|
||||
* @ingroup los_sched
|
||||
* @brief Get the time, in nanoseconds, remaining before the next tick interrupt response.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to get the time, in nanoseconds, remaining before the next tick interrupt response.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval #time, in nanoseconds.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_sched.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
extern UINT64 LOS_SchedTickTimeoutNsGet(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_sched
|
||||
* @brief The system-provided tick interrupt handler.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to wake up a task that is blocked by time.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_sched.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
extern VOID LOS_SchedTickHandler(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_sched
|
||||
* @brief Trigger a system dispatch.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to trigger a system dispatch.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @retval None.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_sched.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see
|
||||
*/
|
||||
extern VOID LOS_Schedule(VOID);
|
||||
|
||||
#if (LOSCFG_BASE_CORE_SCHED_SLEEP == 1)
|
||||
VOID OsSchedUpdateSleepTime(VOID);
|
||||
|
||||
VOID OsSchedToSleep(VOID);
|
||||
|
||||
typedef UINT32 (*SchedSleepInit)(VOID);
|
||||
|
||||
typedef VOID (*SchedSleepStart)(UINT64);
|
||||
|
||||
typedef VOID (*SchedSleepStop)(VOID);
|
||||
|
||||
typedef UINT64 (*SchedSleepGetSleepTimeNs)(VOID);
|
||||
|
||||
extern UINT32 LOS_SchedSleepInit(SchedSleepInit init, SchedSleepStart start,
|
||||
SchedSleepStop stop, SchedSleepGetSleepTimeNs getTime);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
||||
@@ -1636,6 +1636,8 @@ extern UINT32 OsGetAllTskInfo(VOID);
|
||||
|
||||
extern VOID *OsTskUserStackInit(VOID* stackPtr, VOID* userSP, UINT32 userStackSize);
|
||||
|
||||
extern UINT32 OsPmEnterHandlerSet(VOID (*func)(BOOL));
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
||||
@@ -124,6 +124,12 @@ extern UINT64 LOS_SysCycleGet(VOID);
|
||||
|
||||
#define OS_NS_PER_TICK (OS_SYS_NS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND)
|
||||
|
||||
#define OS_SYS_CYCLE_TO_NS(cycle, freq) (((cycle) / (freq)) * OS_SYS_NS_PER_SECOND + \
|
||||
((cycle) % OS_SYS_CLOCK) * OS_SYS_NS_PER_SECOND / (freq))
|
||||
|
||||
#define OS_SYS_NS_TO_CYCLE(time, freq) (((time) / OS_SYS_NS_PER_SECOND) * (freq) + \
|
||||
(time % OS_SYS_NS_PER_SECOND) * (freq) / OS_SYS_NS_PER_SECOND)
|
||||
|
||||
/**
|
||||
* @ingroup los_tick
|
||||
* System time basic function error code: Null pointer.
|
||||
|
||||
Reference in New Issue
Block a user