pm: Change pm_power_state_next_get to support SMP

Change the API to account multiple CPUs.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-10-29 16:11:16 -07:00 committed by Anas Nashif
commit 8c3d9afed7
2 changed files with 5 additions and 4 deletions

View file

@ -178,9 +178,10 @@ void pm_power_state_set(struct pm_state_info info);
* This function returns the next power state that will be used by the * This function returns the next power state that will be used by the
* SoC. * SoC.
* *
* @param cpu CPU index.
* @return next pm_state_info that will be used * @return next pm_state_info that will be used
*/ */
const struct pm_state_info pm_power_state_next_get(void); const struct pm_state_info pm_power_state_next_get(uint8_t cpu);
/** /**
* @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.
@ -209,7 +210,7 @@ void pm_power_state_exit_post_ops(struct pm_state_info info);
#define pm_power_state_set(info) #define pm_power_state_set(info)
#define pm_power_state_exit_post_ops(info) #define pm_power_state_exit_post_ops(info)
#define pm_power_state_next_get() \ #define pm_power_state_next_get(cpu) \
((struct pm_state_info){PM_STATE_ACTIVE, 0, 0}) ((struct pm_state_info){PM_STATE_ACTIVE, 0, 0})
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */

View file

@ -365,7 +365,7 @@ int pm_notifier_unregister(struct pm_notifier *notifier)
return ret; return ret;
} }
const struct pm_state_info pm_power_state_next_get(void) const struct pm_state_info pm_power_state_next_get(uint8_t cpu)
{ {
return z_power_states[_current_cpu->id]; return z_power_states[cpu];
} }