pkarashchenko commented on code in PR #6286:
URL: https://github.com/apache/incubator-nuttx/pull/6286#discussion_r876483360


##########
arch/z80/include/irq.h:
##########
@@ -32,4 +32,55 @@
 #include <nuttx/irq.h>
 #include <arch/chip/irq.h>
 
+#ifndef __ASSEMBLY__
+#  include <stdbool.h>
+#  include "chip/switch.h"
+#endif
+
+/****************************************************************************
+ * Inline functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_interrupt_context
+ *
+ * Description:
+ *   Return true is we are currently executing in the interrupt
+ *   handler context.
+ *
+ ****************************************************************************/
+
+#ifndef __ASSEMBLY__
+static inline bool up_interrupt_context(void)
+{
+  return IN_INTERRUPT();
+}
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_cpu_index
+ *
+ * Description:
+ *   Return an index in the range of 0 through (CONFIG_SMP_NCPUS-1) that
+ *   corresponds to the currently executing CPU.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   An integer index in the range of 0 through (CONFIG_SMP_NCPUS-1) that
+ *   corresponds to the currently executing CPU.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SMP
+int up_cpu_index(void);
+#else
+#  define up_cpu_index() (0)
+#endif
+#endif

Review Comment:
   can we include `nuttx/arch.h` right after `#include <nuttx/irq.h>` in arch 
irq.h files?



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

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

Reply via email to