pm: Move z_pm_save_idle_exit to pm subsys

There is no need to this function be defined inside the kernel since
all places using it are protecting the call under ifdef PM guards.

This way we can also remove the ifdef condition inside the implementation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2024-04-29 10:49:22 -07:00 committed by Carles Cufí
commit f7437ac3b1
3 changed files with 20 additions and 17 deletions

View file

@ -116,6 +116,10 @@ int pm_notifier_unregister(struct pm_notifier *notifier);
*/
const struct pm_state_info *pm_state_next_get(uint8_t cpu);
/** @cond INTERNAL_HIDDEN */
void z_pm_save_idle_exit(void);
/** @endcond */
/**
* @}
*/
@ -175,10 +179,11 @@ static inline const struct pm_state_info *pm_state_next_get(uint8_t cpu)
return NULL;
}
static inline void z_pm_save_idle_exit(void)
{
}
#endif /* CONFIG_PM */
void z_pm_save_idle_exit(void);
#ifdef __cplusplus
}
#endif

View file

@ -18,21 +18,6 @@
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
void z_pm_save_idle_exit(void)
{
#ifdef CONFIG_PM
/* Some CPU low power states require notification at the ISR
* to allow any operations that needs to be done before kernel
* switches task or processes nested interrupts.
* This can be simply ignored if not required.
*/
pm_system_resume();
#endif /* CONFIG_PM */
#ifdef CONFIG_SYS_CLOCK_EXISTS
sys_clock_idle_exit();
#endif /* CONFIG_SYS_CLOCK_EXISTS */
}
void idle(void *unused1, void *unused2, void *unused3)
{
ARG_UNUSED(unused1);

View file

@ -280,3 +280,16 @@ const struct pm_state_info *pm_state_next_get(uint8_t cpu)
{
return &z_cpus_pm_state[cpu];
}
void z_pm_save_idle_exit(void)
{
/* Some CPU low power states require notification at the ISR
* to allow any operations that needs to be done before kernel
* switches task or processes nested interrupts.
* This can be simply ignored if not required.
*/
pm_system_resume();
#ifdef CONFIG_SYS_CLOCK_EXISTS
sys_clock_idle_exit();
#endif /* CONFIG_SYS_CLOCK_EXISTS */
}