summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2019-06-06 16:06:21 -0600
committerCommit Bot <commit-bot@chromium.org>2019-06-11 19:51:17 +0000
commitb662af8066a01502429b84879c4e3a885ec10e1b (patch)
tree3b066c18b9ea1402e162de007d367c2018bf598d /include
parent59d060ebfe68082f4ea87214ffcda976c55176af (diff)
downloadchrome-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 'include')
-rw-r--r--include/link_defs.h1
-rw-r--r--include/task.h17
2 files changed, 18 insertions, 0 deletions
diff --git a/include/link_defs.h b/include/link_defs.h
index efabebe300..f2da82262f 100644
--- a/include/link_defs.h
+++ b/include/link_defs.h
@@ -95,6 +95,7 @@ extern const struct mkbp_event_source __mkbp_evt_srcs_end[];
extern const struct irq_priority __irqprio[];
extern const struct irq_priority __irqprio_end[];
extern const void *__irqhandler[];
+extern const struct irq_def __irq_data[], __irq_data_end[];
/* Shared memory buffer. Use via shared_mem.h interface. */
extern uint8_t __shared_mem_buf[];
diff --git a/include/task.h b/include/task.h
index d56a91986e..d68cd74ea2 100644
--- a/include/task.h
+++ b/include/task.h
@@ -329,6 +329,23 @@ struct irq_priority {
};
/*
+ * Some cores may make use of this struct for mapping irqs to handlers
+ * for DECLARE_IRQ in a linker-script defined section.
+ */
+struct irq_def {
+ int irq;
+
+ /* The routine which was declared as an IRQ */
+ void (*routine)(void);
+
+ /*
+ * The routine usually needs wrapped so the core can handle it
+ * as an IRQ.
+ */
+ void (*handler)(void);
+};
+
+/*
* Implement the DECLARE_IRQ(irq, routine, priority) macro which is
* a core specific helper macro to declare an interrupt handler "routine".
*/