power: rename _sys_suspend/_sys_resume

Be consistent in PM namespaces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-09-04 10:52:31 -04:00
commit e3937453a6
8 changed files with 27 additions and 27 deletions

View file

@ -156,7 +156,7 @@ done_mpu_regions_reset:
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
jl @_sys_resume_from_deep_sleep
jl @pm_system_resume_from_deep_sleep
#endif
#if defined(CONFIG_SMP) || CONFIG_MP_NUM_CPUS > 1

View file

@ -38,7 +38,7 @@
#endif
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
GTEXT(_sys_resume_from_deep_sleep)
GTEXT(pm_system_resume_from_deep_sleep)
#endif
SECTION_FUNC(TEXT_START, __start)
@ -134,13 +134,13 @@ __csSet:
* the ISR stack size are some multiple of ARCH_STACK_PTR_ALIGN, which
* is at least 4.
*
* This is also used to call the _sys_resume_from_deep_sleep()
* This is also used to call the pm_system_resume_from_deep_sleep()
* routine to avoid memory corruption if the system is resuming from
* deep sleep. It is important that _sys_resume_from_deep_sleep()
* deep sleep. It is important that pm_system_resume_from_deep_sleep()
* restores the stack pointer to what it was at deep sleep before
* enabling interrupts. This is necessary to avoid
* interfering with interrupt handler use of this stack.
* If it is a cold boot then _sys_resume_from_deep_sleep() should
* If it is a cold boot then pm_system_resume_from_deep_sleep() should
* not do anything and must return immediately.
*/
#ifdef CONFIG_INIT_STACKS
@ -166,7 +166,7 @@ __csSet:
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
/*
* Invoke _sys_resume_from_deep_sleep() hook to handle resume from
* Invoke pm_system_resume_from_deep_sleep() hook to handle resume from
* deep sleep. It should first check whether system is recovering from
* deep sleep state. If it is, then this function should restore
* states and resume at the point system went to deep sleep.
@ -177,7 +177,7 @@ __csSet:
* return and execution falls through to cold boot path.
*/
call _sys_resume_from_deep_sleep
call pm_system_resume_from_deep_sleep
#endif

View file

@ -133,10 +133,10 @@ static inline bool pm_is_deep_sleep_state(enum power_states state)
/**
* @brief Function to disable power management idle exit notification
*
* The _sys_resume() would be called from the ISR of the event that caused
* The pm_system_resume() would be called from the ISR of the event that caused
* exit from kernel idling after PM operations. For some power operations,
* this notification may not be necessary. This function can be called in
* _sys_suspend to disable the corresponding _sys_resume notification.
* pm_system_suspend to disable the corresponding pm_system_resume notification.
*
*/
static inline void _pm_idle_exit_notification_disable(void)
@ -240,13 +240,13 @@ bool pm_ctrl_is_state_enabled(enum power_states state);
*
* @note This function is not supported on all architectures.
*/
void _sys_resume_from_deep_sleep(void);
void pm_system_resume_from_deep_sleep(void);
/**
* @brief Notify exit from kernel idling after PM operations
*
* This function would notify exit from kernel idling if a corresponding
* _sys_suspend() notification was handled and did not return
* pm_system_suspend() notification was handled and did not return
* POWER_STATE_ACTIVE.
*
* This function would be called from the ISR context of the event
@ -259,9 +259,9 @@ void _sys_resume_from_deep_sleep(void);
* the CPU, before code following the CPU wait, gets a chance to execute. This
* can be ignored if no operation needs to be done at the wake event
* notification. Alternatively _pm_idle_exit_notification_disable() can
* be called in _sys_suspend to disable this notification.
* be called in pm_system_suspend to disable this notification.
*/
void _sys_resume(void);
void pm_system_resume(void);
/**
* @brief Allow entry to power state
@ -286,7 +286,7 @@ void _sys_resume(void);
* @return Power state which was entered or POWER_STATE_ACTIVE if SoC was
* kept in the active state.
*/
enum power_states _sys_suspend(int32_t ticks);
enum power_states pm_system_suspend(int32_t ticks);
/**
* @brief Do any SoC or architecture specific post ops after sleep state exits.

View file

@ -31,7 +31,7 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
#ifdef CONFIG_PM
/*
* Used to allow _sys_suspend() implementation to control notification
* Used to allow pm_system_suspend() implementation to control notification
* of the event that caused exit from kernel idling after pm operations.
*/
unsigned char pm_idle_exit_notify;
@ -41,13 +41,13 @@ unsigned char pm_idle_exit_notify;
* These are almost certainly overidden and in any event do nothing
*/
#if defined(CONFIG_PM_SLEEP_STATES)
void __attribute__((weak)) _sys_resume(void)
void __attribute__((weak)) pm_system_resume(void)
{
}
#endif
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
void __attribute__((weak)) _sys_resume_from_deep_sleep(void)
void __attribute__((weak)) pm_system_resume_from_deep_sleep(void)
{
}
#endif
@ -107,7 +107,7 @@ static void pm_save_idle(void)
* idle processing re-enables interrupts which is essential for
* the kernel's scheduling logic.
*/
if (_sys_suspend(ticks) == POWER_STATE_ACTIVE) {
if (pm_system_suspend(ticks) == POWER_STATE_ACTIVE) {
pm_idle_exit_notify = 0U;
k_cpu_idle();
}
@ -127,7 +127,7 @@ void z_pm_save_idle_exit(int32_t ticks)
* Alternatively it can be simply ignored if not required.
*/
if (pm_idle_exit_notify) {
_sys_resume();
pm_system_resume();
}
#endif

View file

@ -103,8 +103,8 @@ static void z_power_soc_sleep(void)
#endif
/*
* Called from _sys_suspend(int32_t ticks) in subsys/power.c
* For deep sleep _sys_suspend has executed all the driver
* Called from pm_system_suspend(int32_t ticks) in subsys/power.c
* For deep sleep pm_system_suspend has executed all the driver
* power management call backs.
*/
void sys_set_power_state(enum power_states state)

View file

@ -83,13 +83,13 @@ void pm_force_power_state(enum power_states state)
#ifdef CONFIG_PM_DIRECT_FORCE_MODE
(void)arch_irq_lock();
forced_pm_state = state;
_sys_suspend(K_TICKS_FOREVER);
pm_system_suspend(K_TICKS_FOREVER);
#else
forced_pm_state = state;
#endif
}
enum power_states _sys_suspend(int32_t ticks)
enum power_states pm_system_suspend(int32_t ticks)
{
bool deep_sleep;
#if CONFIG_PM_DEVICE
@ -167,7 +167,7 @@ enum power_states _sys_suspend(int32_t ticks)
return pm_state;
}
void _sys_resume(void)
void pm_system_resume(void)
{
/*
* This notification is called from the ISR of the event

View file

@ -93,7 +93,7 @@ void test_call_stacks_analyze_main(void)
*
* @ingroup kernel_profiling_tests
*
* @see k_thread_foreach(), _sys_suspend(), _sys_resume(),
* @see k_thread_foreach(), pm_system_suspend(), pm_system_resume(),
* log_stack_usage()
*/
void test_call_stacks_analyze_idle(void)

View file

@ -53,8 +53,8 @@ __weak void sys_set_power_state(enum power_states state)
__weak void _pm_power_state_exit_post_ops(enum power_states state)
{
/* _sys_suspend is entered with irq locked
* unlock irq before leave _sys_suspend
/* pm_system_suspend is entered with irq locked
* unlock irq before leave pm_system_suspend
*/
irq_unlock(0);
}