diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2019-06-06 16:06:21 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-11 19:51:17 +0000 |
commit | b662af8066a01502429b84879c4e3a885ec10e1b (patch) | |
tree | 3b066c18b9ea1402e162de007d367c2018bf598d /core/minute-ia/interrupts.c | |
parent | 59d060ebfe68082f4ea87214ffcda976c55176af (diff) | |
download | chrome-ec-b662af8066a01502429b84879c4e3a885ec10e1b.tar.gz |
minute-ia: move IRQ definitions to common files
By moving the __irq_data extern declaration into link_defs.h, the
struct can be used in more than just interrupts.c.
In addition, this provides a common struct definiton for IRQ
definitions consisting of an IRQ number, the assigned routine, and a
handler function, which is a fairly common way to store IRQ
definitions.
BUG=none
BRANCH=none
TEST=arcada ISH functions as normal
Change-Id: Idbb5780ae965faeade74cfe319364f61dd933d9e
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1649375
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'core/minute-ia/interrupts.c')
-rw-r--r-- | core/minute-ia/interrupts.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/minute-ia/interrupts.c b/core/minute-ia/interrupts.c index 3ce0e2a2a4..275dba1e9d 100644 --- a/core/minute-ia/interrupts.c +++ b/core/minute-ia/interrupts.c @@ -11,9 +11,10 @@ #include "ia_structs.h" #include "interrupts.h" #include "irq_handler.h" +#include "link_defs.h" #include "registers.h" -#include "task_defs.h" #include "task.h" +#include "task_defs.h" #include "util.h" /* Console output macros */ @@ -385,9 +386,6 @@ void unhandled_vector(void) asm("" : : "a" (vec)); } -/* This needs to be moved to link_defs.h */ -extern const struct irq_data __irq_data[], __irq_data_end[]; - /** * Called from SOFTIRQ_VECTOR when software is trigger an IRQ manually * @@ -395,7 +393,7 @@ extern const struct irq_data __irq_data[], __irq_data_end[]; */ void call_irq_service_routine(uint32_t irq) { - const struct irq_data *p = __irq_data; + const struct irq_def *p = __irq_data; /* If just rescheduling a task, we won't have a routine to call */ if (irq >= CONFIG_IRQ_COUNT) @@ -415,13 +413,14 @@ void call_irq_service_routine(uint32_t irq) void init_interrupts(void) { unsigned entry; - const struct irq_data *p = __irq_data; + const struct irq_def *p; unsigned num_system_irqs = ARRAY_SIZE(system_irqs); unsigned max_entries = (read_ioapic_reg(IOAPIC_VERSION) >> 16) & 0xff; /* Setup gates for IRQs declared by drivers using DECLARE_IRQ */ - for (; p < __irq_data_end; p++) - set_interrupt_gate(IRQ_TO_VEC(p->irq), p->ioapic_routine, + for (p = __irq_data; p < __irq_data_end; p++) + set_interrupt_gate(IRQ_TO_VEC(p->irq), + p->handler, IDT_DESC_FLAGS); /* Software generated IRQ */ |