mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
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:
committed by
Petro Karashchenko
parent
07758d9b58
commit
6e66603da5
+11
-1
@@ -146,7 +146,17 @@ static inline uintptr_t up_getsp(void)
|
|||||||
|
|
||||||
static inline bool up_interrupt_context(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
|
#undef EXTERN
|
||||||
|
|||||||
Reference in New Issue
Block a user