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:
parent
59415697c4
commit
f7437ac3b1
3 changed files with 20 additions and 17 deletions
|
@ -116,6 +116,10 @@ int pm_notifier_unregister(struct pm_notifier *notifier);
|
||||||
*/
|
*/
|
||||||
const struct pm_state_info *pm_state_next_get(uint8_t cpu);
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
static inline void z_pm_save_idle_exit(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
void z_pm_save_idle_exit(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,21 +18,6 @@
|
||||||
|
|
||||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
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)
|
void idle(void *unused1, void *unused2, void *unused3)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(unused1);
|
ARG_UNUSED(unused1);
|
||||||
|
|
|
@ -280,3 +280,16 @@ const struct pm_state_info *pm_state_next_get(uint8_t cpu)
|
||||||
{
|
{
|
||||||
return &z_cpus_pm_state[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 */
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue