You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/29 00:33:16 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1912: Fix up_interrupt_context() for SMP

patacongo commented on a change in pull request #1912:
URL: https://github.com/apache/incubator-nuttx/pull/1912#discussion_r496308387



##########
File path: arch/arm/src/common/arm_interruptcontext.c
##########
@@ -59,5 +59,15 @@
 
 bool up_interrupt_context(void)
 {
-  return CURRENT_REGS != NULL;
+#ifdef CONFIG_SMP
+  irqstate_t flags = up_irq_save();

Review comment:
       Just to clarify, it is non-atomic in the SMP case because CURRENT_REGS expands to:
   
       #  define CURRENT_REGS (g_current_regs[up_cpu_index()])
   
   In the non-SMP case, it expands to:
   
       #  define CURRENT_REGS (g_current_regs[0])
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org