interrupts: new static IRQ API
The interrupt API has been redesigned:
- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
It will be used in situations where the new static irq_connect()
won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
exactly the same way as its dynamic counterpart. The old static irq
macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
generated inline with irq_connect()
ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.
Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
diff --git a/drivers/shared_irq/shared_irq.c b/drivers/shared_irq/shared_irq.c
index e89dbb4..8dc94e3 100644
--- a/drivers/shared_irq/shared_irq.c
+++ b/drivers/shared_irq/shared_irq.c
@@ -128,13 +128,13 @@
struct shared_irq_config *config = dev->config->config_info;
dev->driver_api = &api_funcs;
- config->config(dev);
+ config->config();
return 0;
}
#if CONFIG_SHARED_IRQ_0
-void shared_irq_config_0_irq(struct device *port);
+void shared_irq_config_0_irq(void);
struct shared_irq_config shared_irq_config_0 = {
.irq_num = CONFIG_SHARED_IRQ_0_IRQ,
@@ -165,26 +165,17 @@
#define SHARED_IRQ_0_FLAGS 0
#endif /* CONFIG_IOAPIC */
-IRQ_CONNECT_STATIC(shared_irq_0, CONFIG_SHARED_IRQ_0_IRQ,
- CONFIG_SHARED_IRQ_0_PRI, shared_irq_isr_0, 0,
- SHARED_IRQ_0_FLAGS);
-
-void shared_irq_config_0_irq(struct device *port)
+void shared_irq_config_0_irq(void)
{
- struct shared_irq_config *config = port->config->config_info;
-
- IRQ_CONFIG(shared_irq_0, config->irq_num);
-}
-
-void shared_irq_isr_0(void *unused)
-{
- shared_irq_isr(&__initconfig_shared_irq_0);
+ irq_connect(CONFIG_SHARED_IRQ_0_IRQ, CONFIG_SHARED_IRQ_0_PRI,
+ shared_irq_isr, SYS_GET_DEVICE(shared_irq_0),
+ SHARED_IRQ_0_FLAGS);
}
#endif /* CONFIG_SHARED_IRQ_0 */
#if CONFIG_SHARED_IRQ_1
-void shared_irq_config_1_irq(struct device *port);
+void shared_irq_config_1_irq(void);
struct shared_irq_config shared_irq_config_1 = {
.irq_num = CONFIG_SHARED_IRQ_1_IRQ,
@@ -215,20 +206,11 @@
#define SHARED_IRQ_1_FLAGS 0
#endif /* CONFIG_IOAPIC */
-IRQ_CONNECT_STATIC(shared_irq_1, CONFIG_SHARED_IRQ_1_IRQ,
- CONFIG_SHARED_IRQ_1_PRI, shared_irq_isr_1, 0,
- SHARED_IRQ_1_FLAGS);
-
-void shared_irq_config_1_irq(struct device *port)
+void shared_irq_config_1_irq(void)
{
- struct shared_irq_config *config = port->config->config_info;
-
- IRQ_CONFIG(shared_irq_1, config->irq_num);
-}
-
-void shared_irq_isr_1(void *unused)
-{
- shared_irq_isr(&__initconfig_shared_irq_1);
+ irq_connect(CONFIG_SHARED_IRQ_1_IRQ, CONFIG_SHARED_IRQ_1_PRI,
+ shared_irq_isr, SYS_GET_DEVICE(shared_irq_1),
+ SHARED_IRQ_1_FLAGS);
}
#endif /* CONFIG_SHARED_IRQ_1 */