summaryrefslogtreecommitdiff
path: root/core/cortex-m/irq_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m/irq_handler.h')
-rw-r--r--core/cortex-m/irq_handler.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/core/cortex-m/irq_handler.h b/core/cortex-m/irq_handler.h
index eb23de7049..b510064652 100644
--- a/core/cortex-m/irq_handler.h
+++ b/core/cortex-m/irq_handler.h
@@ -23,20 +23,19 @@
* ensure it is enabled in the interrupt controller with the right priority.
*/
#define DECLARE_IRQ(irq, routine, priority) DECLARE_IRQ_(irq, routine, priority)
-#define DECLARE_IRQ_(irq, routine, priority) \
- void IRQ_HANDLER(irq)(void); \
- typedef struct { \
- int fake[irq >= CONFIG_IRQ_COUNT ? -1 : 1]; \
- } irq_num_check_##irq; \
- static void __keep routine(void); \
- void IRQ_HANDLER(irq)(void) \
- { \
- void *ret = __builtin_return_address(0); \
- TASK_START_IRQ_HANDLER(ret); \
- routine(); \
- task_resched_if_needed(ret); \
- } \
- const struct irq_priority __keep IRQ_PRIORITY(irq) \
- __attribute__((section(".rodata.irqprio"))) = { irq, \
- priority }
+#define DECLARE_IRQ_(irq, routine, priority) \
+ void IRQ_HANDLER(irq)(void); \
+ typedef struct { \
+ int fake[irq >= CONFIG_IRQ_COUNT ? -1 : 1]; \
+ } irq_num_check_##irq; \
+ static void __keep routine(void); \
+ void IRQ_HANDLER(irq)(void) \
+ { \
+ void *ret = __builtin_return_address(0); \
+ TASK_START_IRQ_HANDLER(ret); \
+ routine(); \
+ task_resched_if_needed(ret); \
+ } \
+ const struct irq_priority __keep IRQ_PRIORITY(irq) __attribute__(( \
+ weak, section(".rodata.irqprio"))) = { irq, priority }
#endif /* __CROS_EC_IRQ_HANDLER_H */