Skip to content

Commit 5b3f800

Browse files
committed
arch: arm: Ignore Wattributes warning in direct ISR
GCC 11 and above may report the following warning for the functions declared with the `interrupt` attribute when compiling FPU-enabled ARM targets: warning: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only' [-Wattributes] This commit disables the above warning because: * For M-profile architectures (Cortex-M), this warning does not apply because the caller saved registers, including the FPU registers, are automatically saved upon exception entry and the callee saved registers are saved by the called functions as per the AAPCS (for more details, see the GitHub issue #49631). * For A- and R-profile architectures (Cortex-A/Cortex-R), this warning is not very helpful either because the Zephyr ARM arch implementation strictly adheres to the AAPCS and, when applicable, only the caller saved registers need be saved upon exception entry. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 1261a9e commit 5b3f800

File tree

1 file changed

+3
-0
lines changed
  • include/zephyr/arch/arm/aarch32

1 file changed

+3
-0
lines changed

include/zephyr/arch/arm/aarch32/irq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,16 @@ static inline void arch_isr_direct_footer(int maybe_swap)
177177

178178
#define ARCH_ISR_DIRECT_DECLARE(name) \
179179
static inline int name##_body(void); \
180+
_Pragma("GCC diagnostic push") \
181+
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \
180182
__attribute__ ((interrupt ("IRQ"))) void name(void) \
181183
{ \
182184
int check_reschedule; \
183185
ISR_DIRECT_HEADER(); \
184186
check_reschedule = name##_body(); \
185187
ISR_DIRECT_FOOTER(check_reschedule); \
186188
} \
189+
_Pragma("GCC diagnostic pop") \
187190
static inline int name##_body(void)
188191

189192
#if defined(CONFIG_DYNAMIC_DIRECT_INTERRUPTS)

0 commit comments

Comments
 (0)