Skip to content

Commit

Permalink
sim: fix sim smp boot regression
Browse files Browse the repository at this point in the history
This commit fixes the regression from apache#13716

Signed-off-by: hujun5 <hujun5@xiaomi.com>
  • Loading branch information
hujun260 committed Oct 9, 2024
1 parent a3568af commit add1aee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions arch/sim/src/sim/posix/sim_hostsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ static void *sim_idle_trampoline(void *arg)

host_cpu_started();

sim_unlock();

/* The idle Loop */

for (; ; )
Expand Down
10 changes: 10 additions & 0 deletions arch/sim/src/sim/sim_doirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@
#include <stdbool.h>
#include <nuttx/arch.h>
#include <sched/sched.h>
#include <nuttx/init.h>

#include "sim_internal.h"

/****************************************************************************
* Public Functions
****************************************************************************/

void sim_unlock(void)
{
/* wait until cpu0 in idle() */

while (!OSINIT_IDLELOOP());

sched_unlock();
}

/****************************************************************************
* Name: sim_doirq
****************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions arch/sim/src/sim/sim_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ extern char **g_argv;

void sim_copyfullstate(xcpt_reg_t *dest, xcpt_reg_t *src);
void *sim_doirq(int irq, void *regs);
void sim_unlock(void);

/* sim_hostmisc.c ***********************************************************/

Expand Down
5 changes: 1 addition & 4 deletions include/nuttx/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@
do \
{ \
g_cpu_irqset = 0; \
SP_DMB(); \
g_cpu_irqlock = SP_UNLOCKED; \
SP_DSB(); \
SP_SEV(); \
spin_unlock_wo_note(&g_cpu_irqlock); \
} \
while (0)
#endif
Expand Down

0 comments on commit add1aee

Please sign in to comment.