diff options
author | Jes B. Klinke <jbk@chromium.org> | 2023-02-01 20:57:04 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-03 22:27:44 +0000 |
commit | 989f9d24a097a8da7de10c5f765f3718597ac73c (patch) | |
tree | c3b804aa0b47e775da6870d71c3c835d66a673f3 | |
parent | b455e3633d767a6cee764f19b7a38cf6dd2d4782 (diff) | |
download | chrome-ec-989f9d24a097a8da7de10c5f765f3718597ac73c.tar.gz |
core/cortex-m: Allow boards to override interrupt priorities
A lot of code in common/ and elsewhere use DECLARE_IRQ() to designate an
interrupt handler, and set a priority.
This CL makes it possible for board code to override the priorities set
in common code via DECLARE_IRQ(), in case of special considerations.
BUG=b:266832220
TEST=./util/compare_build.sh -b {discovery,munna}
Change-Id: Ied7afe110301b578178159c51033be7fd86abc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4216265
Tested-by: Jes Klinke <jbk@chromium.org>
Commit-Queue: Jes Klinke <jbk@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | core/cortex-m/irq_handler.h | 31 |
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 */ |