diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-01-25 19:38:44 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-01-25 22:47:12 +0000 |
commit | c89bea4a5b183f24d71277aa6b9d55c92001eda7 (patch) | |
tree | e4c7f61e72015e7da7f7edc17f1d268ab502bfd4 /include/task.h | |
parent | 59d55ece06240dd5284bb01f90087a41c50f4f4c (diff) | |
download | chrome-ec-c89bea4a5b183f24d71277aa6b9d55c92001eda7.tar.gz |
Go back to SoC independant IRQ vectors declaration
Preparatory work to introduce a second SoC : 1/5
Instead of putting hardcoded IRQ SoC name in the vector table,
upgrade the DECLARE_IRQ macro to expand its argument.
Also add a parameter to set the size of the NVIC table to save flash
memory.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=run EC on BDS and see timer IRQs firing.
Change-Id: I44fefdabdd37d756492a71f24554979c72c1b50f
Diffstat (limited to 'include/task.h')
-rw-r--r-- | include/task.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/task.h b/include/task.h index 5cf3336841..555fbd7f6d 100644 --- a/include/task.h +++ b/include/task.h @@ -102,17 +102,16 @@ struct irq_priority { uint8_t priority; }; +/* Helper macros to build the IRQ handler name */ +#define IRQ_BUILD_NAME(prefix, irqnum, postfix) prefix ## irqnum ## postfix +#define IRQ_HANDLER(irqname) IRQ_BUILD_NAME(irq_,irqname,_handler) + /** * Connects the interrupt handler "routine" to the irq number "irq" and * ensures it is enabled in the interrupt controller with the right priority. - * - * Note that you MUST pass irq using a LM4_IRQ_* constant from register.h, not - * as a number, and not as some other #defined constant, because it's - * stringized and matched up with a weak reference from init.S. (This is still - * better than passing it as a raw number, because that's more typo-prone.) */ #define DECLARE_IRQ(irq, routine, priority) \ - void irq_##irq##_handler(void) \ + void IRQ_HANDLER(irq)(void) \ { \ void *ret = __builtin_return_address(0); \ routine(); \ |