Skip to content

Commit

Permalink
Revert "pm: Remove CURRENT_CPU macro"
Browse files Browse the repository at this point in the history
This reverts commit b9d4b9d.

Needed to avoid assert in SOF CI test run as seen
on thesofproject/sof#8901

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i committed Mar 5, 2024
1 parent 9d1df13 commit f26f0bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions subsys/pm/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(pm, CONFIG_PM_LOG_LEVEL);

#define CURRENT_CPU \
(COND_CODE_1(CONFIG_SMP, (arch_curr_cpu()->id), (_current_cpu->id)))

static ATOMIC_DEFINE(z_post_ops_required, CONFIG_MP_MAX_NUM_CPUS);
static sys_slist_t pm_notifiers = SYS_SLIST_STATIC_INIT(&pm_notifiers);

Expand Down Expand Up @@ -130,7 +133,7 @@ static inline void pm_state_notify(bool entering_state)

void pm_system_resume(void)
{
uint8_t id = _current_cpu->id;
uint8_t id = CURRENT_CPU;

/*
* This notification is called from the ISR of the event
Expand Down Expand Up @@ -168,7 +171,7 @@ bool pm_state_force(uint8_t cpu, const struct pm_state_info *info)

bool pm_system_suspend(int32_t ticks)
{
uint8_t id = _current_cpu->id;
uint8_t id = CURRENT_CPU;
k_spinlock_key_t key;

SYS_PORT_TRACING_FUNC_ENTER(pm, system_suspend, ticks);
Expand Down

0 comments on commit f26f0bc

Please sign in to comment.