arch/sim: Disable interrupt in up_interrupt_context for SMP
like other arch to fix the race condition Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
07758d9b58
commit
6e66603da5
|
@ -146,7 +146,17 @@ static inline uintptr_t up_getsp(void)
|
|||
|
||||
static inline bool up_interrupt_context(void)
|
||||
{
|
||||
return CURRENT_REGS != NULL;
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = CURRENT_REGS != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#undef EXTERN
|
||||
|
|
Loading…
Reference in New Issue