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) && \ #if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE) !defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
jl @_sys_resume_from_deep_sleep jl @pm_system_resume_from_deep_sleep
#endif #endif
#if defined(CONFIG_SMP) || CONFIG_MP_NUM_CPUS > 1 #if defined(CONFIG_SMP) || CONFIG_MP_NUM_CPUS > 1

View file

@ -38,7 +38,7 @@
#endif #endif
#ifdef CONFIG_PM_DEEP_SLEEP_STATES #ifdef CONFIG_PM_DEEP_SLEEP_STATES
GTEXT(_sys_resume_from_deep_sleep) GTEXT(pm_system_resume_from_deep_sleep)
#endif #endif
SECTION_FUNC(TEXT_START, __start) SECTION_FUNC(TEXT_START, __start)
@ -134,13 +134,13 @@ __csSet:
* the ISR stack size are some multiple of ARCH_STACK_PTR_ALIGN, which * the ISR stack size are some multiple of ARCH_STACK_PTR_ALIGN, which
* is at least 4. * 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 * 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 * restores the stack pointer to what it was at deep sleep before
* enabling interrupts. This is necessary to avoid * enabling interrupts. This is necessary to avoid
* interfering with interrupt handler use of this stack. * 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. * not do anything and must return immediately.
*/ */
#ifdef CONFIG_INIT_STACKS #ifdef CONFIG_INIT_STACKS
@ -166,7 +166,7 @@ __csSet:
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \ #if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE) !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. It should first check whether system is recovering from
* deep sleep state. If it is, then this function should restore * deep sleep state. If it is, then this function should restore
* states and resume at the point system went to deep sleep. * 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. * return and execution falls through to cold boot path.
*/ */
call _sys_resume_from_deep_sleep call pm_system_resume_from_deep_sleep
#endif #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 * @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, * exit from kernel idling after PM operations. For some power operations,
* this notification may not be necessary. This function can be called in * 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) 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. * @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 * @brief Notify exit from kernel idling after PM operations
* *
* This function would notify exit from kernel idling if a corresponding * 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. * POWER_STATE_ACTIVE.
* *
* This function would be called from the ISR context of the event * 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 * 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 * can be ignored if no operation needs to be done at the wake event
* notification. Alternatively _pm_idle_exit_notification_disable() can * 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 * @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 * @return Power state which was entered or POWER_STATE_ACTIVE if SoC was
* kept in the active state. * 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. * @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 #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. * of the event that caused exit from kernel idling after pm operations.
*/ */
unsigned char pm_idle_exit_notify; 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 * These are almost certainly overidden and in any event do nothing
*/ */
#if defined(CONFIG_PM_SLEEP_STATES) #if defined(CONFIG_PM_SLEEP_STATES)
void __attribute__((weak)) _sys_resume(void) void __attribute__((weak)) pm_system_resume(void)
{ {
} }
#endif #endif
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) #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 #endif
@ -107,7 +107,7 @@ static void pm_save_idle(void)
* idle processing re-enables interrupts which is essential for * idle processing re-enables interrupts which is essential for
* the kernel's scheduling logic. * 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; pm_idle_exit_notify = 0U;
k_cpu_idle(); 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. * Alternatively it can be simply ignored if not required.
*/ */
if (pm_idle_exit_notify) { if (pm_idle_exit_notify) {
_sys_resume(); pm_system_resume();
} }
#endif #endif

View file

@ -103,8 +103,8 @@ static void z_power_soc_sleep(void)
#endif #endif
/* /*
* Called from _sys_suspend(int32_t ticks) in subsys/power.c * Called from pm_system_suspend(int32_t ticks) in subsys/power.c
* For deep sleep _sys_suspend has executed all the driver * For deep sleep pm_system_suspend has executed all the driver
* power management call backs. * power management call backs.
*/ */
void sys_set_power_state(enum power_states state) 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 #ifdef CONFIG_PM_DIRECT_FORCE_MODE
(void)arch_irq_lock(); (void)arch_irq_lock();
forced_pm_state = state; forced_pm_state = state;
_sys_suspend(K_TICKS_FOREVER); pm_system_suspend(K_TICKS_FOREVER);
#else #else
forced_pm_state = state; forced_pm_state = state;
#endif #endif
} }
enum power_states _sys_suspend(int32_t ticks) enum power_states pm_system_suspend(int32_t ticks)
{ {
bool deep_sleep; bool deep_sleep;
#if CONFIG_PM_DEVICE #if CONFIG_PM_DEVICE
@ -167,7 +167,7 @@ enum power_states _sys_suspend(int32_t ticks)
return pm_state; return pm_state;
} }
void _sys_resume(void) void pm_system_resume(void)
{ {
/* /*
* This notification is called from the ISR of the event * 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 * @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() * log_stack_usage()
*/ */
void test_call_stacks_analyze_idle(void) 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) __weak void _pm_power_state_exit_post_ops(enum power_states state)
{ {
/* _sys_suspend is entered with irq locked /* pm_system_suspend is entered with irq locked
* unlock irq before leave _sys_suspend * unlock irq before leave pm_system_suspend
*/ */
irq_unlock(0); irq_unlock(0);
} }