pkarashchenko commented on code in PR #6286: URL: https://github.com/apache/incubator-nuttx/pull/6286#discussion_r875859659
########## arch/arm/include/irq.h: ########## @@ -29,6 +29,12 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> +#ifndef __ASSEMBLY__ +# include <stdbool.h> +#endif +#include <sys/types.h> Review Comment: I would better reorganized this in ```suggestion #include <sys/types.h> #ifndef __ASSEMBLY__ # include <stdbool.h> #endif ``` here and in other places ########## 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: Why do we need this in platform files if we have it already present in `include/nuttx/arch.h`? -- 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