diff --git a/arch/arm/include/arm/irq.h b/arch/arm/include/arm/irq.h index b5c853e5b63af..efb8397ce59f8 100644 --- a/arch/arm/include/arm/irq.h +++ b/arch/arm/include/arm/irq.h @@ -244,6 +244,16 @@ static inline_function bool up_interrupt_context(void) #endif } +noinstrument_function +static inline_function void up_set_interrupt_context(bool flag) +{ +#ifdef CONFIG_ARCH_HAVE_MULTICPU + g_interrupt_context[up_cpu_index()] = flag; +#else + g_interrupt_context[0] = flag; +#endif +} + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index e10cdcc5b4f0b..be4e38301e23e 100644 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -476,6 +476,12 @@ static inline_function bool up_interrupt_context(void) return (bool)CP15_GET(TPIDRPRW); } +noinstrument_function +static inline_function void up_set_interrupt_context(bool flag) +{ + CP15_SET(TPIDRPRW, flag); +} + /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/arch/arm/include/armv7-r/irq.h b/arch/arm/include/armv7-r/irq.h index d8bad2a9392df..4abb50ed532c3 100644 --- a/arch/arm/include/armv7-r/irq.h +++ b/arch/arm/include/armv7-r/irq.h @@ -471,6 +471,12 @@ static inline_function bool up_interrupt_context(void) return (bool)CP15_GET(TPIDRPRW); } +noinstrument_function +static inline_function void up_set_interrupt_context(bool flag) +{ + CP15_SET(TPIDRPRW, flag); +} + /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/arch/arm/include/armv8-r/irq.h b/arch/arm/include/armv8-r/irq.h index 30de6ca2a9263..6be61fd28167d 100644 --- a/arch/arm/include/armv8-r/irq.h +++ b/arch/arm/include/armv8-r/irq.h @@ -471,6 +471,12 @@ static inline_function bool up_interrupt_context(void) return (bool)CP15_GET(TPIDRPRW); } +noinstrument_function +static inline_function void up_set_interrupt_context(bool flag) +{ + CP15_SET(TPIDRPRW, flag); +} + /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index d7a26d790466b..115f9f14b689d 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -273,6 +273,16 @@ static inline_function bool up_interrupt_context(void) #endif } +noinstrument_function +static inline_function void up_set_interrupt_context(bool flag) +{ +#ifdef CONFIG_ARCH_HAVE_MULTICPU + g_interrupt_context[up_cpu_index()] = flag; +#else + g_interrupt_context[0] = flag; +#endif +} + #define up_switch_context(tcb, rtcb) \ do { \ if (!up_interrupt_context()) \ diff --git a/arch/arm/src/common/arm_initialize.c b/arch/arm/src/common/arm_initialize.c index d7c0b5a257528..9265f2722bb18 100644 --- a/arch/arm/src/common/arm_initialize.c +++ b/arch/arm/src/common/arm_initialize.c @@ -34,9 +34,7 @@ /* g_interrupt_context store irq status */ -#if defined(CONFIG_ARCH_ARM) volatile bool g_interrupt_context[CONFIG_SMP_NCPUS]; -#endif /**************************************************************************** * Private Functions diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h index 1e4e13ea3a711..6303c6fc96da4 100644 --- a/arch/arm/src/common/arm_internal.h +++ b/arch/arm/src/common/arm_internal.h @@ -410,14 +410,6 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr); uint32_t *arm_syscall(uint32_t *regs); uint32_t *arm_undefinedinsn(uint32_t *regs); -/* IRQ Flag */ - -noinstrument_function -static inline_function void up_set_interrupt_context(bool flag) -{ - CP15_SET(TPIDRPRW, flag); -} - /* Exception handling logic common to other ARM7 and ARM9 family. */ #else /* ARM7 | ARM9 */ @@ -439,14 +431,6 @@ void arm_prefetchabort(uint32_t *regs); uint32_t *arm_syscall(uint32_t *regs); void arm_undefinedinsn(uint32_t *regs); -/* IRQ Flag */ - -noinstrument_function -static inline_function void up_set_interrupt_context(bool flag) -{ - g_interrupt_context[this_cpu()] = flag; -} - #endif /* CONFIG_ARCH_ARMV[6-8]M */ void arm_vectorundefinsn(void);