Skip to content

Commit

Permalink
sim: fix context-switch when do wdog callback()
Browse files Browse the repository at this point in the history
Signed-off-by: ligd <liguiding1@xiaomi.com>
  • Loading branch information
GUIDINGLI authored and xiaoxiang781216 committed Oct 8, 2024
1 parent ba3a55b commit a3568af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/sim/src/sim/sim_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ void up_idle(void)
#ifdef CONFIG_PM
static enum pm_state_e state = PM_NORMAL;
enum pm_state_e newstate;
#endif
irqstate_t flags;

/* Fake some power management stuff for testing purposes */

flags = enter_critical_section();
sched_lock();

#ifdef CONFIG_PM
/* Fake some power management stuff for testing purposes */

newstate = pm_checkstate(PM_IDLE_DOMAIN);
if (newstate != state)
{
Expand All @@ -83,8 +85,8 @@ void up_idle(void)

#ifdef CONFIG_PM
pm_changestate(PM_IDLE_DOMAIN, PM_RESTORE);
#endif

sched_unlock();
leave_critical_section(flags);
#endif
}

0 comments on commit a3568af

Please sign in to comment.