arch: arm: Fix up_interrupt_context() for SMP
Summary: - I found an issue with up_interrupt_context() when testing. - And finally found that up_interrupt_context() is not atomic. - This commit fixes the issue Impact: - Affects SMP only Testing: - Tested with spresense:wifi_smp and sabre-6quad:smp (qemu) Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
22b837f440
commit
bbc6571b28
1 changed files with 11 additions and 1 deletions
|
@ -59,5 +59,15 @@
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue