summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arc/core/irq_manage.c2
-rw-r--r--arch/arc/soc/quark_se_ss/soc_config.c6
-rw-r--r--arch/arm/core/irq_manage.c2
-rw-r--r--arch/x86/core/Makefile3
-rw-r--r--arch/x86/core/driver_static_irq_stubs.S43
-rw-r--r--arch/x86/core/intconnect.c2
-rw-r--r--arch/x86/soc/quark_se/soc_config.c6
-rw-r--r--doc/kernel/nanokernel/nanokernel_interrupts.rst38
-rw-r--r--doc/platform/frdm_k64f.rst2
-rw-r--r--drivers/adc/adc_dw.c31
-rw-r--r--drivers/adc/adc_dw.h6
-rw-r--r--drivers/aio/Makefile2
-rw-r--r--drivers/aio/aio_dw_comparator.c13
-rw-r--r--drivers/aio/aio_static_irq_stubs.S34
-rw-r--r--drivers/bluetooth/Makefile4
-rw-r--r--drivers/bluetooth/h4.c7
-rw-r--r--drivers/bluetooth/h5.c8
-rw-r--r--drivers/bluetooth/uart_static_irq_stubs.S38
-rw-r--r--drivers/console/Makefile4
-rw-r--r--drivers/console/uart_console.c7
-rw-r--r--drivers/console/uart_console_static_irq_stubs.S44
-rw-r--r--drivers/console/uart_pipe.c8
-rw-r--r--drivers/ethernet/Makefile2
-rw-r--r--drivers/ethernet/eth_dw.c15
-rw-r--r--drivers/ethernet/eth_static_irq_stubs.S34
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/gpio_dw.c28
-rw-r--r--drivers/gpio/gpio_static_irq_stubs.S41
-rw-r--r--drivers/i2c/Makefile2
-rw-r--r--drivers/i2c/i2c_dw.c24
-rw-r--r--drivers/i2c/i2c_quark_se_ss.c8
-rw-r--r--drivers/i2c/i2c_static_irq_stubs.S42
-rw-r--r--drivers/interrupt_controller/ioapic_intr.c2
-rw-r--r--drivers/interrupt_controller/loapic_intr.c2
-rw-r--r--drivers/interrupt_controller/system_apic.c4
-rw-r--r--drivers/ipm/Makefile2
-rw-r--r--drivers/ipm/ipm_static_irq_stubs.S28
-rw-r--r--drivers/rtc/Makefile1
-rw-r--r--drivers/rtc/rtc_dw.c34
-rw-r--r--drivers/rtc/rtc_qmsi.c6
-rw-r--r--drivers/rtc/rtc_static_irq_stubs.S38
-rw-r--r--drivers/shared_irq/Makefile1
-rw-r--r--drivers/shared_irq/shared_irq.c40
-rw-r--r--drivers/shared_irq/shared_irq_static_irq_stubs.S29
-rw-r--r--drivers/spi/Makefile2
-rw-r--r--drivers/spi/dw_spi.c45
-rw-r--r--drivers/spi/dw_spi_priv.h2
-rw-r--r--drivers/spi/intel_spi.c32
-rw-r--r--drivers/spi/intel_spi_priv.h2
-rw-r--r--drivers/spi/spi_static_irq_stubs.S40
-rw-r--r--drivers/timer/arcv2_timer0.c6
-rw-r--r--drivers/timer/hpet.c6
-rw-r--r--drivers/timer/loapic_timer.c11
-rw-r--r--drivers/watchdog/Makefile2
-rw-r--r--drivers/watchdog/wdt_dw.c34
-rw-r--r--drivers/watchdog/wdt_qmsi.c6
-rw-r--r--drivers/watchdog/wdt_static_irq_stubs.S38
-rw-r--r--include/arch/arc/arch.h68
-rw-r--r--include/arch/arc/v2/irq.h2
-rw-r--r--include/arch/arm/cortex_m/irq.h63
-rw-r--r--include/arch/x86/arch.h149
-rw-r--r--include/drivers/ioapic.h4
-rw-r--r--include/drivers/loapic.h35
-rw-r--r--include/shared_irq.h2
-rw-r--r--kernel/microkernel/k_irq.c6
-rw-r--r--samples/microkernel/benchmark/footprint/src/microkernel_footprint.c2
-rw-r--r--samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c2
-rw-r--r--samples/nanokernel/benchmark/object_footprint/src/nanokernel_objects.c2
-rw-r--r--samples/nanokernel/test/test_context/src/README5
-rw-r--r--samples/nanokernel/test/test_context/src/context.c2
70 files changed, 343 insertions, 919 deletions
diff --git a/arch/arc/core/irq_manage.c b/arch/arc/core/irq_manage.c
index 2976e66ed..99e2254d2 100644
--- a/arch/arc/core/irq_manage.c
+++ b/arch/arc/core/irq_manage.c
@@ -155,7 +155,7 @@ void _irq_spurious(void *unused)
* @return the interrupt line number
*/
-int irq_connect(
+int irq_connect_dynamic(
unsigned int irq,
unsigned int prio,
void (*isr)(void *arg),
diff --git a/arch/arc/soc/quark_se_ss/soc_config.c b/arch/arc/soc/quark_se_ss/soc_config.c
index 6563a1aaa..3fb772482 100644
--- a/arch/arc/soc/quark_se_ss/soc_config.c
+++ b/arch/arc/soc/quark_se_ss/soc_config.c
@@ -22,12 +22,10 @@
#include <ipm.h>
#include <ipm/ipm_quark_se.h>
-IRQ_CONNECT_STATIC(quark_se_ipm, QUARK_SE_IPM_INTERRUPT,
- QUARK_SE_IPM_INTERRUPT_PRI, quark_se_ipm_isr, NULL, 0);
-
static int arc_quark_se_ipm_init(void)
{
- IRQ_CONFIG(quark_se_ipm, QUARK_SE_IPM_INTERRUPT);
+ irq_connect(QUARK_SE_IPM_INTERRUPT, QUARK_SE_IPM_INTERRUPT_PRI,
+ quark_se_ipm_isr, NULL, 0);
irq_enable(QUARK_SE_IPM_INTERRUPT);
return DEV_OK;
}
diff --git a/arch/arm/core/irq_manage.c b/arch/arm/core/irq_manage.c
index cb1af4f9f..f10e37f0a 100644
--- a/arch/arm/core/irq_manage.c
+++ b/arch/arm/core/irq_manage.c
@@ -136,7 +136,7 @@ void _irq_spurious(void *unused)
*
* @return the interrupt line number
*/
-int irq_connect(unsigned int irq,
+int irq_connect_dynamic(unsigned int irq,
unsigned int prio,
void (*isr)(void *arg),
void *arg,
diff --git a/arch/x86/core/Makefile b/arch/x86/core/Makefile
index 25c39f055..514cad1b3 100644
--- a/arch/x86/core/Makefile
+++ b/arch/x86/core/Makefile
@@ -20,8 +20,7 @@ endif
obj-y += gdt.o fatal.o cpuhalt.o \
msr.o dynamic.o intconnect.o \
excconnect.o sys_fatal_error_handler.o \
- crt0.o driver_static_irq_stubs.o \
- atomic.o cache_s.o cache.o excstub.o
+ crt0.o atomic.o cache_s.o cache.o excstub.o
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
obj-$(CONFIG_FP_SHARING) += float.o
diff --git a/arch/x86/core/driver_static_irq_stubs.S b/arch/x86/core/driver_static_irq_stubs.S
deleted file mode 100644
index d354afcd0..000000000
--- a/arch/x86/core/driver_static_irq_stubs.S
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2012-2015, Wind River Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief Interrupt stubs
- *
- * This module contains the static interrupt stubs for the various drivers employed
- * by x86 platforms.
- */
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#include <drivers/loapic.h>
-#include <drivers/system_timer.h>
-
-#if defined(CONFIG_LOAPIC_TIMER)
- loapic_mkstub loapic _timer_int_handler 0
-#endif
-
-#if defined(CONFIG_HPET_TIMER)
- ioapic_mkstub hpet _timer_int_handler 0
-#endif
-
- /* externs (internal APIs) */
-
- GTEXT(_IntEnt)
- GTEXT(_IntExit)
diff --git a/arch/x86/core/intconnect.c b/arch/x86/core/intconnect.c
index 860228a2d..27f7c8c83 100644
--- a/arch/x86/core/intconnect.c
+++ b/arch/x86/core/intconnect.c
@@ -202,7 +202,7 @@ extern void *_DynIntStubsBegin;
* vectors remaining in the specified <priority> level.
*/
-int irq_connect(unsigned int irq, unsigned int priority,
+int irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
{
diff --git a/arch/x86/soc/quark_se/soc_config.c b/arch/x86/soc/quark_se/soc_config.c
index 3d3cffde2..99b77d6ed 100644
--- a/arch/x86/soc/quark_se/soc_config.c
+++ b/arch/x86/soc/quark_se/soc_config.c
@@ -27,12 +27,10 @@
#include <ipm.h>
#include <ipm/ipm_quark_se.h>
-IRQ_CONNECT_STATIC(quark_se_ipm, QUARK_SE_IPM_INTERRUPT, QUARK_SE_IPM_INTERRUPT_PRI,
- quark_se_ipm_isr, NULL, 0);
-
static int x86_quark_se_ipm_init(void)
{
- IRQ_CONFIG(quark_se_ipm, QUARK_SE_IPM_INTERRUPT);
+ irq_connect(QUARK_SE_IPM_INTERRUPT, QUARK_SE_IPM_INTERRUPT_PRI,
+ quark_se_ipm_isr, NULL, 0);
irq_enable(QUARK_SE_IPM_INTERRUPT);
return DEV_OK;
}
diff --git a/doc/kernel/nanokernel/nanokernel_interrupts.rst b/doc/kernel/nanokernel/nanokernel_interrupts.rst
index 2c1e61462..0aaa780d8 100644
--- a/doc/kernel/nanokernel/nanokernel_interrupts.rst
+++ b/doc/kernel/nanokernel/nanokernel_interrupts.rst
@@ -95,7 +95,8 @@ Example
#define MY_DEV_IRQ 24 /* device uses IRQ 24 */
#define MY_DEV_PRIO 2 /* device uses interrupt priority 2 */
- #define MY_ISR_ARG 17 /* argument passed to my_isr() */
+ /* argument passed to my_isr(), in this case a pointer to the device */
+ #define MY_ISR_ARG SYS_GET_DEVICE(my_device)
#define MY_IRQ_FLAGS 0 /* IRQ flags. Unused on non-x86 */
void my_isr(void *arg)
@@ -103,23 +104,14 @@ Example
... /* ISR code */
}
- IRQ_CONNECT_STATIC(my_dev, MY_DEV_IRQ, MY_DEV_PRIO, my_isr, MY_ISR_ARG,
- MY_IRQ_FLAGS);
-
void my_isr_installer(void)
{
...
- IRQ_CONFIG(my_dev, MY_DEV_IRQ); /* finish IRQ configuration */
+ irq_connect(MY_DEV_IRQ, MY_DEV_PRIO, my_isr, MY_ISR_ARG, MY_IRQ_FLAGS);
irq_enable(MY_DEV_IRQ); /* enable IRQ */
...
}
-For x86 platforms only, you must also create an interrupt stub as follows:
-
-.. code-block:: asm
-
- ioapic_mkstub my_dev my_isr
-
Installing a Dynamic ISR
========================
@@ -127,11 +119,6 @@ Use a dynamic ISR to register an interrupt handler when the interrupt
parameters can be found out only at runtime, or when a device is not always
present in the system.
-.. note::
-
- There is no API method to uninstall a dynamic ISR; however, it is
- possible to replace it with a different dynamic ISR.
-
Prerequisites
-------------
@@ -161,7 +148,8 @@ This is an example of a dynamic interrupt for x86:
void my_isr_installer(void)
{
...
- irq_connect(MY_DEV_IRQ, MY_DEV_PRIO, my_isr, MY_ISR_ARG, MY_IRQ_FLAGS);
+ irq_connect_dynamic(MY_DEV_IRQ, MY_DEV_PRIO, my_isr, MY_ISR_ARG,
+ MY_IRQ_FLAGS);
...
irq_enable(MY_DEV_IRQ);
...
@@ -235,20 +223,18 @@ IDT Security
Ideally, the IDT memory area should be protected against accidental
modification, in the same way that text and read-only data areas
-are protected.
-
-Currently, the IDT is always located read-write memory and is
-therefore *not* protected. This is true even for systems using
-:abbr:`XIP (Execute in Place)`, where the text and read-only data areas
-reside in read-only memory (such as flash memory or ROM).
+are protected. If no dynamic interrupts are in use, i.e.
+:option:`NUM_DYNAMIC_STUBS` is 0, the IDT will be located in ROM.
+If a particular project is ROM space-constrained, it's possible to
+force the IDT to be located in RAM via :option:`FORCE_IRQ_VECTOR_TABLE_RAM`.
APIs
****
These are the interrupt-related Application Program Interfaces.
-:c:func:`irq_connect()`
+:c:func:`irq_connect_dynamic()`
Registers a dynamic ISR with the IDT and interrupt controller.
:c:func:`irq_enable()`
@@ -268,8 +254,6 @@ Macros
These are the macros used to install a static ISR.
-:c:macro:`IRQ_CONNECT_STATIC( )`
+:c:macro:`irq_connect()`
Registers a static ISR with the IDT.
-:c:macro:`IRQ_CONFIG( )`
- Registers a static ISR with the interrupt controller.
diff --git a/doc/platform/frdm_k64f.rst b/doc/platform/frdm_k64f.rst
index 179aec4c6..19cc5f01e 100644
--- a/doc/platform/frdm_k64f.rst
+++ b/doc/platform/frdm_k64f.rst
@@ -277,7 +277,7 @@ For example, if 3 bits are implemented, use 1, 2, and 3,
not 0x20h, 0x40h, and 0x60h.
Interrupt priority is set using the *prio* parameter of
-:c:func:`irq_connect()`.
+:c:macro:`irq_connect()` or :c:func:`irq_connect_dynamic()`.
The range of available priorities is different if using Zero Latency Interrupts
(ZLI) or not.
diff --git a/drivers/adc/adc_dw.c b/drivers/adc/adc_dw.c
index 567b4d9f2..0321a5595 100644
--- a/drivers/adc/adc_dw.c
+++ b/drivers/adc/adc_dw.c
@@ -53,7 +53,7 @@
#else
#define int_unmask(...) { ; }
#endif
-static void adc_config_0_irq(struct device *dev);
+static void adc_config_0_irq(void);
static void adc_goto_normal_mode_wo_calibration(void)
{
@@ -259,7 +259,7 @@ int adc_dw_init(struct device *dev)
sys_out32(ADC_INT_ENABLE & ~(ADC_CLK_ENABLE),
adc_base + ADC_CTRL);
- config->config_func(dev);
+ config->config_func();
int_unmask(config->reg_irq_mask);
int_unmask(config->reg_err_mask);
@@ -340,8 +340,6 @@ struct adc_config adc_config_dev_0 = {
.reg_base = PERIPH_ADDR_BASE_ADC,
.reg_irq_mask = SCSS_REGISTER_BASE + INT_SS_ADC_IRQ_MASK,
.reg_err_mask = SCSS_REGISTER_BASE + INT_SS_ADC_ERR_MASK,
- .rx_vector = CONFIG_ADC_DW_0_RX_IRQ,
- .err_vector = CONFIG_ADC_DW_0_ERR_IRQ,
#ifdef CONFIG_ADC_DW_SINGLE_ENDED
.in_mode = 0,
#elif CONFIG_ADC_DW_DIFFERENTIAL
@@ -376,25 +374,14 @@ DECLARE_DEVICE_INIT_CONFIG(adc_dw_0, /* config name*/
SYS_DEFINE_DEVICE(adc_dw_0, &adc_info_dev_0, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
-IRQ_CONNECT_STATIC(adc_dw_0_rx,
- CONFIG_ADC_DW_0_RX_IRQ,
- CONFIG_ADC_DW_0_PRI,
- adc_dw_rx_isr,
- SYS_GET_DEVICE(adc_dw_0), 0);
-
-IRQ_CONNECT_STATIC(adc_dw_0_err,
- CONFIG_ADC_DW_0_ERR_IRQ,
- CONFIG_ADC_DW_0_PRI,
- adc_dw_err_isr,
- SYS_GET_DEVICE(adc_dw_0), 0);
-
-static void adc_config_0_irq(struct device *dev)
+static void adc_config_0_irq(void)
{
- struct adc_config *config = dev->config->config_info;
+ irq_connect(CONFIG_ADC_DW_0_RX_IRQ, CONFIG_ADC_DW_0_PRI, adc_dw_rx_isr,
+ SYS_GET_DEVICE(adc_dw_0), 0);
+ irq_enable(CONFIG_ADC_DW_0_RX_IRQ);
- IRQ_CONFIG(adc_dw_0_rx, CONFIG_ADC_DW_0_RX_IRQ);
- irq_enable(config->rx_vector);
- IRQ_CONFIG(adc_dw_0_err, CONFIG_ADC_DW_0_ERR_IRQ);
- irq_enable(config->err_vector);
+ irq_connect(CONFIG_ADC_DW_0_ERR_IRQ, CONFIG_ADC_DW_0_PRI,
+ adc_dw_err_isr, SYS_GET_DEVICE(adc_dw_0), 0);
+ irq_enable(CONFIG_ADC_DW_0_ERR_IRQ);
}
#endif
diff --git a/drivers/adc/adc_dw.h b/drivers/adc/adc_dw.h
index 9a549b7bf..424005d29 100644
--- a/drivers/adc/adc_dw.h
+++ b/drivers/adc/adc_dw.h
@@ -145,7 +145,7 @@
#define ss_adc_data_to_mv(_data_, _resolution_) \
((_data_ * ADC_VREF) / (1 << _resolution_))
-typedef void (*adc_dw_config_t)(struct device *dev);
+typedef void (*adc_dw_config_t)(void);
/** @brief ADC configuration
* This structure defines the ADC configuration values
* that define the ADC hardware instance and configuration.
@@ -157,10 +157,6 @@ struct adc_config {
uint32_t reg_irq_mask;
/**IIO address for the error mask register.*/
uint32_t reg_err_mask;
- /**Interruption vector for the reception ISR.*/
- uint8_t rx_vector;
- /**Interruption vector for the error ISR.*/
- uint8_t err_vector;
/**Input mode*/
uint8_t in_mode;
/**Output mode*/
diff --git a/drivers/aio/Makefile b/drivers/aio/Makefile
index 3f0ec5a98..ffe5ab226 100644
--- a/drivers/aio/Makefile
+++ b/drivers/aio/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_AIO_DW_COMPARATOR) += aio_dw_comparator.o aio_static_irq_stubs.o
+obj-$(CONFIG_AIO_DW_COMPARATOR) += aio_dw_comparator.o
diff --git a/drivers/aio/aio_dw_comparator.c b/drivers/aio/aio_dw_comparator.c
index f5ed27fee..7484d64b2 100644
--- a/drivers/aio/aio_dw_comparator.c
+++ b/drivers/aio/aio_dw_comparator.c
@@ -213,20 +213,11 @@ struct dw_aio_cmp_dev_data_t dw_aio_cmp_dev_data = {
SYS_DEFINE_DEVICE(dw_aio_cmp, &dw_aio_cmp_dev_data, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
-struct device *dw_aio_cmp_device = SYS_GET_DEVICE(dw_aio_cmp);
-
-IRQ_CONNECT_STATIC(dw_aio_cmp,
- INT_AIO_CMP_IRQ,
- 0,
- dw_aio_cmp_isr,
- 0,
- 0);
-
static int dw_aio_cmp_config(struct device *dev)
{
ARG_UNUSED(dev);
- IRQ_CONFIG(dw_aio_cmp, INT_AIO_CMP_IRQ);
-
+ irq_connect(INT_AIO_CMP_IRQ, 0, dw_aio_cmp_isr,
+ SYS_GET_DEVICE(dw_aio_cmp), 0);
return DEV_OK;
}
diff --git a/drivers/aio/aio_static_irq_stubs.S b/drivers/aio/aio_static_irq_stubs.S
deleted file mode 100644
index bd9fe78ce..000000000
--- a/drivers/aio/aio_static_irq_stubs.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief AIO interrupt stubs
- * This module contains the static interrupt stubs for the aio driver
- */
-
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-#if defined(CONFIG_AIO_DW_COMPARATOR)
-#if defined(CONFIG_IOAPIC)
- ioapic_mkstub dw_aio_cmp dw_aio_cmp_isr dw_aio_cmp_device
-#endif
-#endif /* CONFIG_AIO_DW_COMPARATOR */
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index 07e319fae..f9bcca378 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_BLUETOOTH_H4) += h4.o uart_static_irq_stubs.o
-obj-$(CONFIG_BLUETOOTH_H5) += h5.o uart_static_irq_stubs.o
+obj-$(CONFIG_BLUETOOTH_H4) += h4.o
+obj-$(CONFIG_BLUETOOTH_H5) += h5.o
diff --git a/drivers/bluetooth/h4.c b/drivers/bluetooth/h4.c
index 32a938704..192cb178d 100644
--- a/drivers/bluetooth/h4.c
+++ b/drivers/bluetooth/h4.c
@@ -218,17 +218,14 @@ static int h4_send(enum bt_buf_type buf_type, struct net_buf *buf)
return 0;
}
-IRQ_CONNECT_STATIC(bluetooth, CONFIG_BLUETOOTH_UART_IRQ,
- CONFIG_BLUETOOTH_UART_IRQ_PRI, bt_uart_isr, 0,
- UART_IRQ_FLAGS);
-
static int h4_open(void)
{
BT_DBG("");
uart_irq_rx_disable(h4_dev);
uart_irq_tx_disable(h4_dev);
- IRQ_CONFIG(bluetooth, CONFIG_BLUETOOTH_UART_IRQ);
+ irq_connect(CONFIG_BLUETOOTH_UART_IRQ, CONFIG_BLUETOOTH_UART_IRQ_PRI,
+ bt_uart_isr, 0, UART_IRQ_FLAGS);
irq_enable(CONFIG_BLUETOOTH_UART_IRQ);
/* Drain the fifo */
diff --git a/drivers/bluetooth/h5.c b/drivers/bluetooth/h5.c
index 6a4d523db..1dac1ee67 100644
--- a/drivers/bluetooth/h5.c
+++ b/drivers/bluetooth/h5.c
@@ -768,17 +768,15 @@ static void h5_init(void)
nano_fifo_init(&h5.unack_queue);
}
-IRQ_CONNECT_STATIC(bluetooth, CONFIG_BLUETOOTH_UART_IRQ,
- CONFIG_BLUETOOTH_UART_IRQ_PRI, bt_uart_isr, 0,
- UART_IRQ_FLAGS);
-
static int h5_open(void)
{
BT_DBG("");
uart_irq_rx_disable(h5_dev);
uart_irq_tx_disable(h5_dev);
- IRQ_CONFIG(bluetooth, CONFIG_BLUETOOTH_UART_IRQ);
+
+ irq_connect(CONFIG_BLUETOOTH_UART_IRQ, CONFIG_BLUETOOTH_UART_IRQ_PRI,
+ bt_uart_isr, 0, UART_IRQ_FLAGS);
irq_enable(CONFIG_BLUETOOTH_UART_IRQ);
/* Drain the fifo */
diff --git a/drivers/bluetooth/uart_static_irq_stubs.S b/drivers/bluetooth/uart_static_irq_stubs.S
deleted file mode 100644
index de9e19f35..000000000
--- a/drivers/bluetooth/uart_static_irq_stubs.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief Bluetooth UART interrupt stubs
- */
-
-#ifdef CONFIG_X86
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#include <drivers/loapic.h>
-
-#if defined(CONFIG_BLUETOOTH_UART)
-#if defined(CONFIG_IOAPIC)
- ioapic_mkstub bluetooth bt_uart_isr 0
-#endif /* CONFIG_IOAPIC */
-#endif /* CONFIG_BLUETOOTH_UART */
-
-#undef _ASMLANGUAGE
-
-#endif /* CONFIG_X86 */
diff --git a/drivers/console/Makefile b/drivers/console/Makefile
index de2e6ba4d..c456b47a6 100644
--- a/drivers/console/Makefile
+++ b/drivers/console/Makefile
@@ -1,6 +1,6 @@
obj-$(CONFIG_CONSOLE_HANDLER_SHELL) += console_handler_shell.o
-obj-$(CONFIG_UART_CONSOLE) += uart_console.o uart_console_static_irq_stubs.o
+obj-$(CONFIG_UART_CONSOLE) += uart_console.o
obj-$(CONFIG_RAM_CONSOLE) += ram_console.o
obj-$(CONFIG_IPM_CONSOLE_RECEIVER) += ipm_console_receiver.o
obj-$(CONFIG_IPM_CONSOLE_SENDER) += ipm_console_sender.o
-obj-$(CONFIG_UART_PIPE) += uart_pipe.o uart_console_static_irq_stubs.o
+obj-$(CONFIG_UART_PIPE) += uart_pipe.o
diff --git a/drivers/console/uart_console.c b/drivers/console/uart_console.c
index b05c38469..645c5d032 100644
--- a/drivers/console/uart_console.c
+++ b/drivers/console/uart_console.c
@@ -366,17 +366,14 @@ void uart_console_isr(void *unused)
}
}
-IRQ_CONNECT_STATIC(console, CONFIG_UART_CONSOLE_IRQ,
- CONFIG_UART_CONSOLE_IRQ_PRI, uart_console_isr, 0,
- UART_IRQ_FLAGS);
-
static void console_input_init(void)
{
uint8_t c;
uart_irq_rx_disable(uart_console_dev);
uart_irq_tx_disable(uart_console_dev);
- IRQ_CONFIG(console, CONFIG_UART_CONSOLE_IRQ);
+ irq_connect(CONFIG_UART_CONSOLE_IRQ, CONFIG_UART_CONSOLE_IRQ_PRI,
+ uart_console_isr, 0, UART_IRQ_FLAGS);
irq_enable(CONFIG_UART_CONSOLE_IRQ);
/* Drain the fifo */
diff --git a/drivers/console/uart_console_static_irq_stubs.S b/drivers/console/uart_console_static_irq_stubs.S
deleted file mode 100644
index 2d9ff9bd5..000000000
--- a/drivers/console/uart_console_static_irq_stubs.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief UART console interrupt stubs
- */
-
-#ifdef CONFIG_X86
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#include <drivers/loapic.h>
-
-#if defined(CONFIG_CONSOLE_HANDLER)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub console uart_console_isr 0
-#endif /* CONFIG_IOAPIC */
-#endif /* CONFIG_CONSOLE_HANDLER */
-
-#if defined(CONFIG_UART_PIPE)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub uart_pipe uart_pipe_isr 0
-#endif /* CONFIG_IOAPIC */
-#endif /* CONFIG_UART_PIPE */
-
-#undef _ASMLANGUAGE
-
-#endif /* CONFIG_X86 */
diff --git a/drivers/console/uart_pipe.c b/drivers/console/uart_pipe.c
index 5a3ff14cb..bd7aa2f87 100644
--- a/drivers/console/uart_pipe.c
+++ b/drivers/console/uart_pipe.c
@@ -72,15 +72,13 @@ int uart_pipe_send(const uint8_t *data, int len)
}
}
-IRQ_CONNECT_STATIC(uart_pipe, CONFIG_UART_PIPE_IRQ,
- CONFIG_UART_PIPE_IRQ_PRI, uart_pipe_isr, 0,
- UART_IRQ_FLAGS);
-
static void uart_pipe_setup(struct device *uart)
{
uart_irq_rx_disable(uart);
uart_irq_tx_disable(uart);
- IRQ_CONFIG(uart_pipe, CONFIG_UART_PIPE_IRQ);
+
+ irq_connect(CONFIG_UART_PIPE_IRQ, CONFIG_UART_PIPE_IRQ_PRI,
+ uart_pipe_isr, 0, UART_IRQ_FLAGS);
irq_enable(CONFIG_UART_PIPE_IRQ);
/* Drain the fifo */
diff --git a/drivers/ethernet/Makefile b/drivers/ethernet/Makefile
index e8858c112..b918a8238 100644
--- a/drivers/ethernet/Makefile
+++ b/drivers/ethernet/Makefile
@@ -3,4 +3,4 @@ ccflags-y += -I${srctree}/net/ip/contiki/os/lib
ccflags-y += -I${srctree}/net/ip/contiki/os
ccflags-y += -I${srctree}
-obj-$(CONFIG_ETH_DW) += eth_dw.o eth_static_irq_stubs.o
+obj-$(CONFIG_ETH_DW) += eth_dw.o
diff --git a/drivers/ethernet/eth_dw.c b/drivers/ethernet/eth_dw.c
index 413398ec6..10c68d199 100644
--- a/drivers/ethernet/eth_dw.c
+++ b/drivers/ethernet/eth_dw.c
@@ -313,11 +313,6 @@ static int eth_net_tx(struct net_buf *buf)
return eth_tx(&__initconfig_eth_dw_0, buf);
}
-#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
-IRQ_CONNECT_STATIC(eth_dw_0, CONFIG_ETH_DW_0_IRQ,
- CONFIG_ETH_DW_0_PRI, eth_dw_isr, 0);
-#endif
-
static void eth_config_0_irq(struct device *port)
{
struct eth_config *config = port->config->config_info;
@@ -325,8 +320,9 @@ static void eth_config_0_irq(struct device *port)
#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(eth_dw_0, config->irq_num);
- irq_enable(config->irq_num);
+ irq_connect(CONFIG_ETH_DW_0_IRQ, CONFIG_ETH_DW_0_PRI, eth_dw_isr,
+ SYS_GET_DEVICE(eth_dw_0), 0);
+ irq_enable(CONFIG_ETH_DW_0_IRQ);
#elif defined(CONFIG_ETH_DW_0_IRQ_SHARED)
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
__ASSERT(shared_irq_dev != NULL, "Failed to get eth_dw device binding");
@@ -334,9 +330,4 @@ static void eth_config_0_irq(struct device *port)
shared_irq_enable(shared_irq_dev, port);
#endif
}
-
-#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
-struct device *eth_dw_isr_0 = SYS_GET_DEVICE(eth_dw_0);
-#endif /* CONFIG_ETH_DW_0_IRQ_DIRECT */
-
#endif /* CONFIG_ETH_DW_0 */
diff --git a/drivers/ethernet/eth_static_irq_stubs.S b/drivers/ethernet/eth_static_irq_stubs.S
deleted file mode 100644
index 6a7774f4a..000000000
--- a/drivers/ethernet/eth_static_irq_stubs.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief Ethernet interrupt stubs
- * This module contains the static interrupt stubs for Ethernet drivers.
- */
-
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-#if defined(CONFIG_ETH_DW)
-#if CONFIG_ETH_DW_0
- ioapic_mkstub eth_dw_0 eth_dw_isr eth_dw_isr_0
-#endif /* CONFIG_ETH_DW_0 */
-#endif /* CONFIG_ETH_DW */
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 9222d972b..7307e9153 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -1,6 +1,5 @@
ccflags-y +=-I$(srctree)/drivers
-obj-$(CONFIG_GPIO) += gpio_static_irq_stubs.o
obj-$(CONFIG_GPIO_DW) += gpio_dw.o
obj-$(CONFIG_GPIO_PCAL9535A) += gpio_pcal9535a.o
obj-$(CONFIG_GPIO_MMIO) += gpio_mmio.o
diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c
index b9053b85d..fe08eb391 100644
--- a/drivers/gpio/gpio_dw.c
+++ b/drivers/gpio/gpio_dw.c
@@ -454,14 +454,12 @@ struct gpio_dw_config gpio_config_0 = {
struct gpio_dw_runtime gpio_0_runtime;
-DECLARE_DEVICE_INIT_CONFIG(gpio_0, CONFIG_GPIO_DW_0_NAME,
+DECLARE_DEVICE_INIT_CONFIG(gpio_dw_0, CONFIG_GPIO_DW_0_NAME,
gpio_dw_initialize, &gpio_config_0);
-SYS_DEFINE_DEVICE(gpio_0, &gpio_0_runtime, SECONDARY,
+SYS_DEFINE_DEVICE(gpio_dw_0, &gpio_0_runtime, SECONDARY,
CONFIG_GPIO_DW_INIT_PRIORITY);
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
-struct device *gpio_dw_isr_0 = SYS_GET_DEVICE(gpio_0);
-
#ifdef CONFIG_IOAPIC
#ifdef CONFIG_GPIO_DW_0
#if defined(CONFIG_GPIO_DW_0_FALLING_EDGE)
@@ -477,11 +475,6 @@ struct device *gpio_dw_isr_0 = SYS_GET_DEVICE(gpio_0);
#else
#define GPIO_DW_0_IRQ_FLAGS 0
#endif
-
-IRQ_CONNECT_STATIC(gpio_dw_0, CONFIG_GPIO_DW_0_IRQ,
- CONFIG_GPIO_DW_0_PRI, gpio_dw_isr,
- SYS_GET_DEVICE(gpio_0),
- GPIO_DW_0_IRQ_FLAGS);
#endif
void gpio_config_0_irq(struct device *port)
@@ -491,7 +484,8 @@ void gpio_config_0_irq(struct device *port)
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(gpio_dw_0, config->irq_num);
+ irq_connect(CONFIG_GPIO_DW_0_IRQ, CONFIG_GPIO_DW_0_PRI, gpio_dw_isr,
+ SYS_GET_DEVICE(gpio_dw_0), GPIO_DW_0_IRQ_FLAGS);
irq_enable(config->irq_num);
#elif defined(CONFIG_GPIO_DW_0_IRQ_SHARED)
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
@@ -534,15 +528,13 @@ struct gpio_dw_config gpio_dw_config_1 = {
struct gpio_dw_runtime gpio_1_runtime;
-DECLARE_DEVICE_INIT_CONFIG(gpio_1, CONFIG_GPIO_DW_1_NAME,
+DECLARE_DEVICE_INIT_CONFIG(gpio_dw_1, CONFIG_GPIO_DW_1_NAME,
gpio_dw_initialize, &gpio_dw_config_1);
-SYS_DEFINE_DEVICE(gpio_1, &gpio_1_runtime, SECONDARY,
+SYS_DEFINE_DEVICE(gpio_dw_1, &gpio_1_runtime, SECONDARY,
CONFIG_GPIO_DW_INIT_PRIORITY);
#ifdef CONFIG_GPIO_DW_1_IRQ_DIRECT
-struct device *gpio_dw_isr_1 = SYS_GET_DEVICE(gpio_1);
-
#ifdef CONFIG_IOAPIC
#ifdef CONFIG_GPIO_DW_1
#if defined(CONFIG_GPIO_DW_1_FALLING_EDGE)
@@ -558,11 +550,6 @@ struct device *gpio_dw_isr_1 = SYS_GET_DEVICE(gpio_1);
#else
#define GPIO_DW_1_IRQ_FLAGS 0
#endif
-
-IRQ_CONNECT_STATIC(gpio_dw_1, CONFIG_GPIO_DW_1_IRQ,
- CONFIG_GPIO_DW_1_PRI, gpio_dw_isr,
- SYS_GET_DEVICE(gpio_1),
- GPIO_DW_1_IRQ_FLAGS);
#endif
void gpio_config_1_irq(struct device *port)
@@ -572,7 +559,8 @@ void gpio_config_1_irq(struct device *port)
#ifdef CONFIG_GPIO_DW_1_IRQ_DIRECT
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(gpio_dw_1, config->irq_num);
+ irq_connect(CONFIG_GPIO_DW_1_IRQ, CONFIG_GPIO_DW_1_PRI, gpio_dw_isr,
+ SYS_GET_DEVICE(gpio_dw_1), GPIO_DW_1_IRQ_FLAGS);
irq_enable(config->irq_num);
#elif defined(CONFIG_GPIO_DW_1_IRQ_SHARED)
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
diff --git a/drivers/gpio/gpio_static_irq_stubs.S b/drivers/gpio/gpio_static_irq_stubs.S
deleted file mode 100644
index 0deb7994f..000000000
--- a/drivers/gpio/gpio_static_irq_stubs.S
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief GPIO interrupt stubs
- * This module contains the static interrupt stubs for the gpio drivers
- */
-
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-
-#ifdef CONFIG_GPIO_DW_0
-#ifdef CONFIG_IOAPIC
- ioapic_mkstub gpio_dw_0 gpio_dw_isr gpio_dw_isr_0
-#endif
-#endif /* CONFIG_GPIO_DW_0 */
-
-#ifdef CONFIG_GPIO_DW_1
-#ifdef CONFIG_IOAPIC
- ioapic_mkstub gpio_dw_1 gpio_dw_isr gpio_dw_isr_1
-#endif
-#endif /* CONFIG_GPIO_DW_1 */
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 424ecc7d5..a67409745 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_I2C_DW) += i2c_dw.o i2c_static_irq_stubs.o
+obj-$(CONFIG_I2C_DW) += i2c_dw.o
obj-$(CONFIG_I2C_QUARK_SE_SS) += i2c_quark_se_ss.o
diff --git a/drivers/i2c/i2c_dw.c b/drivers/i2c/i2c_dw.c
index a4a470353..2caa437e6 100644
--- a/drivers/i2c/i2c_dw.c
+++ b/drivers/i2c/i2c_dw.c
@@ -779,16 +779,6 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_0,
&i2c_config_dw_0);
SYS_DEFINE_DEVICE(i2c_0, &i2c_0_runtime, SECONDARY, CONFIG_I2C_INIT_PRIORITY);
-struct device *i2c_dw_isr_0_device = SYS_GET_DEVICE(i2c_0);
-
-#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT
-IRQ_CONNECT_STATIC(i2c_dw_0,
- CONFIG_I2C_DW_0_IRQ,
- CONFIG_I2C_DW_0_INT_PRIORITY,
- i2c_dw_isr,
- SYS_GET_DEVICE(i2c_0),
- I2C_DW_IRQ_FLAGS);
-#endif
void i2c_config_0(struct device *port)
{
@@ -797,7 +787,8 @@ void i2c_config_0(struct device *port)
#if defined(CONFIG_I2C_DW_0_IRQ_DIRECT)
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(i2c_dw_0, config->irq_num);
+ irq_connect(CONFIG_I2C_DW_0_IRQ, CONFIG_I2C_DW_0_INT_PRIORITY,
+ i2c_dw_isr, SYS_GET_DEVICE(i2c_0), I2C_DW_IRQ_FLAGS);
irq_enable(config->irq_num);
#elif defined(CONFIG_I2C_DW_0_IRQ_SHARED)
ARG_UNUSED(config);
@@ -842,14 +833,6 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_1,
SYS_DEFINE_DEVICE(i2c_1, &i2c_1_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
-struct device *i2c_dw_isr_1_device = SYS_GET_DEVICE(i2c_1);
-
-IRQ_CONNECT_STATIC(i2c_dw_1,
- CONFIG_I2C_DW_1_IRQ,
- CONFIG_I2C_DW_1_INT_PRIORITY,
- i2c_dw_isr,
- SYS_GET_DEVICE(i2c_1),
- I2C_DW_IRQ_FLAGS);
void i2c_config_1(struct device *port)
{
@@ -857,7 +840,8 @@ void i2c_config_1(struct device *port)
struct device *shared_irq_dev;
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(i2c_dw_1, config->irq_num);
+ irq_connect(CONFIG_I2C_DW_1_IRQ, CONFIG_I2C_DW_1_INT_PRIORITY,
+ i2c_dw_isr, SYS_GET_DEVICE(i2c_1), I2C_DW_IRQ_FLAGS);
irq_enable(config->irq_num);
}
diff --git a/drivers/i2c/i2c_quark_se_ss.c b/drivers/i2c/i2c_quark_se_ss.c
index 9a9ccc804..3947f7350 100644
--- a/drivers/i2c/i2c_quark_se_ss.c
+++ b/drivers/i2c/i2c_quark_se_ss.c
@@ -668,10 +668,10 @@ void _i2c_qse_ss_config_irq(struct device *port)
_i2c_qse_ss_memory_write(SCSS_REGISTER_BASE, rom->isr_stop_mask, mask);
/* Connect the IRQs to ISR */
- irq_connect(rom->isr_err_vector, 1, i2c_qse_ss_isr, port, 0);
- irq_connect(rom->isr_rx_vector, 1, i2c_qse_ss_isr, port, 0);
- irq_connect(rom->isr_tx_vector, 1, i2c_qse_ss_isr, port, 0);
- irq_connect(rom->isr_stop_vector, 1, i2c_qse_ss_isr, port, 0);
+ irq_connect_dynamic(rom->isr_err_vector, 1, i2c_qse_ss_isr, port, 0);
+ irq_connect_dynamic(rom->isr_rx_vector, 1, i2c_qse_ss_isr, port, 0);
+ irq_connect_dynamic(rom->isr_tx_vector, 1, i2c_qse_ss_isr, port, 0);
+ irq_connect_dynamic(rom->isr_stop_vector, 1, i2c_qse_ss_isr, port, 0);
irq_enable(rom->isr_err_vector);
irq_enable(rom->isr_rx_vector);
diff --git a/drivers/i2c/i2c_static_irq_stubs.S b/drivers/i2c/i2c_static_irq_stubs.S
deleted file mode 100644
index 85a87cbb9..000000000
--- a/drivers/i2c/i2c_static_irq_stubs.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @brief I2C interrupt stubs
- * This module contains the static interrupt stubs for the i2c drivers
- */
-
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-#if defined(CONFIG_I2C_DW_0)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub i2c_dw_0 i2c_dw_isr i2c_dw_isr_0_device
-#endif
-#endif /* CONFIG_I2C_DW_0 */
-
-#if defined(CONFIG_I2C_DW_1)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub i2c_dw_1 i2c_dw_isr i2c_dw_isr_1_device
-#endif
-#endif /* CONFIG_I2C_DW_1 */
-
-
diff --git a/drivers/interrupt_controller/ioapic_intr.c b/drivers/interrupt_controller/ioapic_intr.c
index e241b9339..ed6ab5f07 100644
--- a/drivers/interrupt_controller/ioapic_intr.c
+++ b/drivers/interrupt_controller/ioapic_intr.c
@@ -113,7 +113,7 @@ int _ioapic_init(struct device *unused)
/*
* Initialize the redirection table entries with default settings;
- * actual interrupt vectors are specified during irq_connect().
+ * actual interrupt vectors are specified during irq_connect_dynamic().
*
* A future enhancement should make this initialization "table driven":
* use data provided by the platform to specify the initial state
diff --git a/drivers/interrupt_controller/loapic_intr.c b/drivers/interrupt_controller/loapic_intr.c
index 7a77c3cd0..8b83d9ee5 100644
--- a/drivers/interrupt_controller/loapic_intr.c
+++ b/drivers/interrupt_controller/loapic_intr.c
@@ -302,7 +302,7 @@ void _loapic_disable(void)
* @brief Set the vector field in the specified RTE
*
* This routine is utilized by the interrupt controller's _SysIntVecAlloc()
- * routine (which exists to support the irq_connect() API). Once
+ * routine (which exists to support the irq_connect_dynamic() API). Once
* a vector has been allocated, this routine is invoked to update the LVT
* entry associated with <irq> with the vector.
*
diff --git a/drivers/interrupt_controller/system_apic.c b/drivers/interrupt_controller/system_apic.c
index 9a71403b8..49af28a14 100644
--- a/drivers/interrupt_controller/system_apic.c
+++ b/drivers/interrupt_controller/system_apic.c
@@ -61,8 +61,8 @@ static int __LocalIntVecAlloc(unsigned int irq, unsigned int priority);
*
* @brief Allocate interrupt vector
*
- * This routine is used by the x86's irq_connect(). It performs the following
- * functions:
+ * This routine is used by the x86's irq_connect_dynamic(). It performs the
+ * following functions:
*
* a) Allocates a vector satisfying the requested priority. The utility
* routine _IntVecAlloc() provided by the nanokernel will be used to
diff --git a/drivers/ipm/Makefile b/drivers/ipm/Makefile
index ff8c31201..7c618ba9d 100644
--- a/drivers/ipm/Makefile
+++ b/drivers/ipm/Makefile
@@ -1,4 +1,4 @@
ccflags-y += -I$(srctree/drivers)
-obj-$(CONFIG_IPM_QUARK_SE) += ipm_quark_se.o ipm_static_irq_stubs.o
+obj-$(CONFIG_IPM_QUARK_SE) += ipm_quark_se.o
diff --git a/drivers/ipm/ipm_static_irq_stubs.S b/drivers/ipm/ipm_static_irq_stubs.S
deleted file mode 100644
index 4694cb58c..000000000
--- a/drivers/ipm/ipm_static_irq_stubs.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-#if defined(CONFIG_IPM_QUARK_SE)
-#if defined(CONFIG_IOAPIC)
- ioapic_mkstub quark_se_ipm quark_se_ipm_isr 0
-#endif
-#endif
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 35115e65f..e1aa56b40 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -1,5 +1,4 @@
ccflags-$(CONFIG_RTC_QMSI) += -I$(CONFIG_QMSI_INSTALL_PATH)/include
-obj-$(CONFIG_RTC) += rtc_static_irq_stubs.o
obj-$(CONFIG_RTC_DW) += rtc_dw.o
obj-$(CONFIG_RTC_QMSI) += rtc_qmsi.o
diff --git a/drivers/rtc/rtc_dw.c b/drivers/rtc/rtc_dw.c
index e10613716..4de8d21b7 100644
--- a/drivers/rtc/rtc_dw.c
+++ b/drivers/rtc/rtc_dw.c
@@ -189,23 +189,7 @@ static struct rtc_driver_api funcs = {
.set_alarm = rtc_dw_set_alarm,
};
-/* IRQ_CONFIG needs the flags variable declared by IRQ_CONNECT_STATIC */
-IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ,
- CONFIG_RTC_IRQ_PRI, rtc_dw_isr, 0, 0);
-
-int rtc_dw_init(struct device *dev)
-{
- IRQ_CONFIG(rtc, CONFIG_RTC_IRQ);
- irq_enable(CONFIG_RTC_IRQ);
-
- _rtc_dw_int_unmask();
-
- _rtc_dw_clock_config(dev);
-
- dev->driver_api = &funcs;
-
- return DEV_OK;
-}
+int rtc_dw_init(struct device *dev);
struct rtc_dw_runtime rtc_runtime;
@@ -222,4 +206,18 @@ DECLARE_DEVICE_INIT_CONFIG(rtc, CONFIG_RTC_DRV_NAME,
SYS_DEFINE_DEVICE(rtc, &rtc_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
-struct device *rtc_dw_isr_dev = SYS_GET_DEVICE(rtc);
+int rtc_dw_init(struct device *dev)
+{
+ irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, rtc_dw_isr,
+ SYS_GET_DEVICE(rtc), 0);
+ irq_enable(CONFIG_RTC_IRQ);
+
+ _rtc_dw_int_unmask();
+
+ _rtc_dw_clock_config(dev);
+
+ dev->driver_api = &funcs;
+
+ return DEV_OK;
+}
+
diff --git a/drivers/rtc/rtc_qmsi.c b/drivers/rtc/rtc_qmsi.c
index d319a54e7..6b5d0dbb6 100644
--- a/drivers/rtc/rtc_qmsi.c
+++ b/drivers/rtc/rtc_qmsi.c
@@ -22,9 +22,6 @@
#include "qm_rtc.h"
-IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0,
- 0, IOAPIC_EDGE | IOAPIC_HIGH);
-
static struct device *rtc_qmsi_dev;
static void (*user_callback)(struct device *dev);
@@ -82,7 +79,8 @@ static struct rtc_driver_api api = {
static int rtc_qmsi_init(struct device *dev)
{
- IRQ_CONFIG(rtc, CONFIG_RTC_IRQ);
+ irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0, 0,
+ IOAPIC_EDGE | IOAPIC_HIGH);
/* Unmask RTC interrupt */
irq_enable(CONFIG_RTC_IRQ);
diff --git a/drivers/rtc/rtc_static_irq_stubs.S b/drivers/rtc/rtc_static_irq_stubs.S
deleted file mode 100644
index 516912d11..000000000
--- a/drivers/rtc/rtc_static_irq_stubs.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corportation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-
-#if defined(CONFIG_RTC_DW)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub rtc rtc_dw_isr rtc_dw_isr_dev
-#endif
-#endif
-
-#if defined(CONFIG_RTC_QMSI)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub rtc qm_rtc_isr_0 0
-#endif
-#endif /* CONFIG_RTC_QMSI */
-
-/* externs (internal APIs) */
-
-GTEXT(_IntEnt)
-GTEXT(_IntExit)
diff --git a/drivers/shared_irq/Makefile b/drivers/shared_irq/Makefile
index a2a04526e..188ba8fa7 100644
--- a/drivers/shared_irq/Makefile
+++ b/drivers/shared_irq/Makefile
@@ -1,4 +1,3 @@
ccflags-y +=-I$(srctree)/drivers
-obj-$(CONFIG_SHARED_IRQ) = shared_irq_static_irq_stubs.o
obj-$(CONFIG_SHARED_IRQ) += shared_irq.o
diff --git a/drivers/shared_irq/shared_irq.c b/drivers/shared_irq/shared_irq.c
index e89dbb47d..8dc94e315 100644
--- a/drivers/shared_irq/shared_irq.c
+++ b/drivers/shared_irq/shared_irq.c
@@ -128,13 +128,13 @@ int shared_irq_initialize(struct device *dev)
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 @@ SYS_DEFINE_DEVICE(shared_irq_0, &shared_irq_0_runtime, SECONDARY,
#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)
-{
- struct shared_irq_config *config = port->config->config_info;
-
- IRQ_CONFIG(shared_irq_0, config->irq_num);
-}
-
-void shared_irq_isr_0(void *unused)
+void shared_irq_config_0_irq(void)
{
- 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 @@ SYS_DEFINE_DEVICE(shared_irq_1, &shared_irq_1_runtime, SECONDARY,
#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)
-{
- struct shared_irq_config *config = port->config->config_info;
-
- IRQ_CONFIG(shared_irq_1, config->irq_num);
-}
-
-void shared_irq_isr_1(void *unused)
+void shared_irq_config_1_irq(void)
{
- 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 */
diff --git a/drivers/shared_irq/shared_irq_static_irq_stubs.S b/drivers/shared_irq/shared_irq_static_irq_stubs.S
deleted file mode 100644
index 5f7e87adf..000000000
--- a/drivers/shared_irq/shared_irq_static_irq_stubs.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2012-2015, Wind River Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-
-
-#if CONFIG_SHARED_IRQ_0
- ioapic_mkstub shared_irq_0 shared_irq_isr_0 0
-#endif /* CONFIG_SHARED_IRQ_0 */
-
-#if CONFIG_SHARED_IRQ_1
- ioapic_mkstub shared_irq_1 shared_irq_isr_1 0
-#endif /* CONFIG_SHARED_IRQ_1 */
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 5abbe7781..07ae38b62 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -1,4 +1,2 @@
-
-obj-$(CONFIG_SPI) = spi_static_irq_stubs.o
obj-$(CONFIG_SPI_INTEL) += intel_spi.o
obj-$(CONFIG_SPI_DW) += dw_spi.o
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c
index 172644ec3..2a4b32127 100644
--- a/drivers/spi/dw_spi.c
+++ b/drivers/spi/dw_spi.c
@@ -459,8 +459,13 @@ int spi_dw_init(struct device *dev)
#endif /* CONFIG_IOAPIC */
#ifdef CONFIG_SPI_DW_PORT_0
-
-void spi_config_0_irq(struct device *dev);
+void spi_config_0_irq(void)
+{
+ irq_connect(CONFIG_SPI_DW_PORT_0_IRQ, CONFIG_SPI_DW_PORT_0_PRI,
+ spi_dw_isr, SYS_GET_DEVICE(spi_dw_port_0),
+ SPI_DW_IRQ_FLAGS);
+ irq_enable(CONFIG_SPI_DW_PORT_0_IRQ);
+}
struct spi_dw_data spi_dw_data_port_0;
@@ -479,24 +484,16 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_0, CONFIG_SPI_DW_PORT_0_DRV_NAME,
SYS_DEFINE_DEVICE(spi_dw_port_0, &spi_dw_data_port_0, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
-struct device *spi_dw_isr_port_0 = SYS_GET_DEVICE(spi_dw_port_0);
-
-IRQ_CONNECT_STATIC(spi_dw_irq_port_0, CONFIG_SPI_DW_PORT_0_IRQ,
- CONFIG_SPI_DW_PORT_0_PRI, spi_dw_isr, 0,
- SPI_DW_IRQ_FLAGS);
-
-void spi_config_0_irq(struct device *dev)
-{
- struct spi_dw_config *config = dev->config->config_info;
-
- IRQ_CONFIG(spi_dw_irq_port_0, config->irq);
- irq_enable(config->irq);
-}
-
#endif /* CONFIG_SPI_DW_PORT_0 */
#ifdef CONFIG_SPI_DW_PORT_1
-void spi_config_1_irq(struct device *dev);
+void spi_config_1_irq(void)
+{
+ irq_connect(CONFIG_SPI_DW_PORT_1_IRQ, CONFIG_SPI_DW_PORT_1_PRI,
+ spi_dw_isr, SYS_GET_DEVICE(spi_dw_port_1),
+ SPI_DW_IRQ_FLAGS);
+ irq_enable(CONFIG_SPI_DW_PORT_1_IRQ);
+}
struct spi_dw_data spi_dw_data_port_1;
@@ -515,18 +512,4 @@ DECLARE_DEVICE_INIT_CONFIG(spi_dw_port_1, CONFIG_SPI_DW_PORT_1_DRV_NAME,
SYS_DEFINE_DEVICE(spi_dw_port_1, &spi_dw_data_port_1, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
-struct device *spi_dw_isr_port_1 = SYS_GET_DEVICE(spi_dw_port_1);
-
-IRQ_CONNECT_STATIC(spi_dw_irq_port_1, CONFIG_SPI_DW_PORT_1_IRQ,
- CONFIG_SPI_DW_PORT_1_PRI, spi_dw_isr, 0,
- SPI_DW_IRQ_FLAGS);
-
-void spi_config_1_irq(struct device *dev)
-{
- struct spi_dw_config *config = dev->config->config_info;
-
- IRQ_CONFIG(spi_dw_irq_port_1, config->irq);
- irq_enable(config->irq);
-}
-
#endif /* CONFIG_SPI_DW_PORT_1 */
diff --git a/drivers/spi/dw_spi_priv.h b/drivers/spi/dw_spi_priv.h
index a81bcb60b..83c5a29a2 100644
--- a/drivers/spi/dw_spi_priv.h
+++ b/drivers/spi/dw_spi_priv.h
@@ -21,7 +21,7 @@
#include <spi.h>
-typedef void (*spi_dw_config_t)(struct device *dev);
+typedef void (*spi_dw_config_t)(void);
/* Private structures */
struct spi_dw_config {
diff --git a/drivers/spi/intel_spi.c b/drivers/spi/intel_spi.c
index 765c6dd7f..12eacc80c 100644
--- a/drivers/spi/intel_spi.c
+++ b/drivers/spi/intel_spi.c
@@ -420,7 +420,7 @@ int spi_intel_init(struct device *dev)
return DEV_NOT_CONFIG;
}
- info->config_func(dev);
+ info->config_func();
_spi_config_cs(dev);
@@ -448,7 +448,7 @@ int spi_intel_init(struct device *dev)
/* system bindings */
#ifdef CONFIG_SPI_INTEL_PORT_0
-void spi_config_0_irq(struct device *dev);
+void spi_config_0_irq(void);
struct spi_intel_data spi_intel_data_port_0;
@@ -476,23 +476,18 @@ DECLARE_DEVICE_INIT_CONFIG(spi_intel_port_0, CONFIG_SPI_INTEL_PORT_0_DRV_NAME,
/* SPI may use GPIO pin for CS, thus it needs to be initialized after GPIO */
SYS_DEFINE_DEVICE(spi_intel_port_0, &spi_intel_data_port_0, SECONDARY,
CONFIG_SPI_INTEL_INIT_PRIORITY);
-struct device *spi_intel_isr_port_0 = SYS_GET_DEVICE(spi_intel_port_0);
-IRQ_CONNECT_STATIC(spi_intel_irq_port_0, CONFIG_SPI_INTEL_PORT_0_IRQ,
- CONFIG_SPI_INTEL_PORT_0_PRI, spi_intel_isr, 0,
- SPI_INTEL_IRQ_FLAGS);
-
-void spi_config_0_irq(struct device *dev)
+void spi_config_0_irq(void)
{
- struct spi_intel_config *config = dev->config->config_info;
-
- IRQ_CONFIG(spi_intel_irq_port_0, config->irq);
+ irq_connect(CONFIG_SPI_INTEL_PORT_0_IRQ, CONFIG_SPI_INTEL_PORT_0_PRI,
+ spi_intel_isr, SYS_GET_DEVICE(spi_intel_port_0),
+ SPI_INTEL_IRQ_FLAGS);
}
#endif /* CONFIG_SPI_INTEL_PORT_0 */
#ifdef CONFIG_SPI_INTEL_PORT_1
-void spi_config_1_irq(struct device *dev);
+void spi_config_1_irq(void);
struct spi_intel_data spi_intel_data_port_1;
@@ -520,17 +515,12 @@ DECLARE_DEVICE_INIT_CONFIG(spi_intel_port_1, CONFIG_SPI_INTEL_PORT_1_DRV_NAME,
/* SPI may use GPIO pin for CS, thus it needs to be initialized after GPIO */
SYS_DEFINE_DEVICE(spi_intel_port_1, &spi_intel_data_port_1, SECONDARY,
CONFIG_SPI_INTEL_INIT_PRIORITY);
-struct device *spi_intel_isr_port_1 = SYS_GET_DEVICE(spi_intel_port_1);
-IRQ_CONNECT_STATIC(spi_intel_irq_port_1, CONFIG_SPI_INTEL_PORT_1_IRQ,
- CONFIG_SPI_INTEL_PORT_1_PRI, spi_intel_isr, 0,
- SPI_INTEL_IRQ_FLAGS);
-
-void spi_config_1_irq(struct device *dev)
+void spi_config_1_irq(void);
{
- struct spi_intel_config *config = dev->config->config_info;
-
- IRQ_CONFIG(spi_intel_irq_port_1, config->irq);
+ irq_connect(CONFIG_SPI_INTEL_PORT_1_IRQ, CONFIG_SPI_INTEL_PORT_1_PRI,
+ spi_intel_isr, SYS_GET_DEVICE(spi_intel_port_1),
+ SPI_INTEL_IRQ_FLAGS);
}
#endif /* CONFIG_SPI_INTEL_PORT_1 */
diff --git a/drivers/spi/intel_spi_priv.h b/drivers/spi/intel_spi_priv.h
index 9b9fcf547..a0e1b8bb7 100644
--- a/drivers/spi/intel_spi_priv.h
+++ b/drivers/spi/intel_spi_priv.h
@@ -24,7 +24,7 @@
#include <pci/pci_mgr.h>
#endif /* CONFIG_PCI */
-typedef void (*spi_intel_config_t)(struct device *dev);
+typedef void (*spi_intel_config_t)(void);
struct spi_intel_config {
uint32_t regs;
diff --git a/drivers/spi/spi_static_irq_stubs.S b/drivers/spi/spi_static_irq_stubs.S
deleted file mode 100644
index 33f6c7afb..000000000
--- a/drivers/spi/spi_static_irq_stubs.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2012-2015, Wind River Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _ASMLANGUAGE
-
-#ifdef CONFIG_X86
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-#endif
-
-#if defined(CONFIG_SPI_INTEL_PORT_0)
- ioapic_mkstub spi_intel_irq_port_0 spi_intel_isr spi_intel_isr_port_0
-#endif /* CONFIG_SPI_INTEL_PORT_0 */
-#if defined(CONFIG_SPI_INTEL_PORT_1)
- ioapic_mkstub spi_intel_irq_port_1 spi_intel_isr spi_intel_isr_port_1
-#endif /* CONFIG_SPI_INTEL_PORT_1 */
-
-#if defined(CONFIG_SPI_DW_PORT_0)
-#ifdef CONFIG_IOAPIC
- ioapic_mkstub spi_dw_irq_port_0 spi_dw_isr spi_dw_isr_port_0
-#endif
-#endif
-#if defined(CONFIG_SPI_DW_PORT_1)
-#ifdef CONFIG_IOAPIC
- ioapic_mkstub spi_dw_irq_port_1 spi_dw_isr spi_dw_isr_port_1
-#endif
-#endif
-
diff --git a/drivers/timer/arcv2_timer0.c b/drivers/timer/arcv2_timer0.c
index ae0032df8..3c967e7a0 100644
--- a/drivers/timer/arcv2_timer0.c
+++ b/drivers/timer/arcv2_timer0.c
@@ -311,9 +311,6 @@ static void tickless_idle_init(void) {}
*/
int _sys_clock_driver_init(struct device *device)
{
- int irq = CONFIG_ARCV2_TIMER0_INT_LVL;
- int prio = CONFIG_ARCV2_TIMER0_INT_PRI;
-
ARG_UNUSED(device);
/* ensure that the timer will not generate interrupts */
@@ -322,7 +319,8 @@ int _sys_clock_driver_init(struct device *device)
cycles_per_tick = sys_clock_hw_cycles_per_tick;
- (void)irq_connect(irq, prio, _timer_int_handler, 0, 0);
+ irq_connect(CONFIG_ARCV2_TIMER0_INT_LVL, CONFIG_ARCV2_TIMER0_INT_PRI,
+ _timer_int_handler, 0, 0);
/*
* Set the reload value to achieve the configured tick rate, enable the
diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c
index 4f5555f8d..59f06d5dc 100644
--- a/drivers/timer/hpet.c
+++ b/drivers/timer/hpet.c
@@ -183,8 +183,6 @@ extern struct nano_stack _k_command_stack;
#define HPET_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
#endif
-IRQ_CONNECT_STATIC(hpet, CONFIG_HPET_TIMER_IRQ, CONFIG_HPET_TIMER_IRQ_PRIORITY,
- _timer_int_handler, 0, HPET_IOAPIC_FLAGS);
#ifdef CONFIG_INT_LATENCY_BENCHMARK
static uint32_t main_count_first_irq_value;
@@ -614,8 +612,8 @@ int _sys_clock_driver_init(struct device *device)
* Although the stub has already been "connected", the vector number
* still has to be programmed into the interrupt controller.
*/
-
- IRQ_CONFIG(hpet, CONFIG_HPET_TIMER_IRQ);
+ irq_connect(CONFIG_HPET_TIMER_IRQ, CONFIG_HPET_TIMER_IRQ_PRIORITY,
+ _timer_int_handler, 0, HPET_IOAPIC_FLAGS);
/* enable the IRQ in the interrupt controller */
diff --git a/drivers/timer/loapic_timer.c b/drivers/timer/loapic_timer.c
index c40c479aa..30f93f3f0 100644
--- a/drivers/timer/loapic_timer.c
+++ b/drivers/timer/loapic_timer.c
@@ -128,10 +128,6 @@
extern int32_t _sys_idle_elapsed_ticks;
#endif /* TIMER_SUPPORTS_TICKLESS */
-IRQ_CONNECT_STATIC(loapic, CONFIG_LOAPIC_TIMER_IRQ,
- CONFIG_LOAPIC_TIMER_IRQ_PRIORITY,
- _timer_int_handler, 0, 0);
-
/* computed counter 0 initial count value */
static uint32_t __noinit cycles_per_tick;
static uint32_t accumulated_cycle_count;
@@ -571,11 +567,8 @@ int _sys_clock_driver_init(struct device *device)
initial_count_register_set(cycles_per_tick - 1);
periodic_mode_set();
- /*
- * Although the stub has already been "connected", the vector number
- * still has to be programmed into the interrupt controller.
- */
- IRQ_CONFIG(loapic, CONFIG_LOAPIC_TIMER_IRQ);
+ irq_connect(CONFIG_LOAPIC_TIMER_IRQ, CONFIG_LOAPIC_TIMER_IRQ_PRIORITY,
+ _timer_int_handler, 0, 0);
/* Everything has been configured. It is now safe to enable the
* interrupt
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index e28b89c0c..0a351e025 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -1,5 +1,3 @@
ccflags-$(CONFIG_WDT_QMSI) +=-I$(CONFIG_QMSI_INSTALL_PATH)/include
-
-obj-$(CONFIG_WATCHDOG) += wdt_static_irq_stubs.o
obj-$(CONFIG_WDT_DW) += wdt_dw.o
obj-$(CONFIG_WDT_QMSI) += wdt_qmsi.o
diff --git a/drivers/watchdog/wdt_dw.c b/drivers/watchdog/wdt_dw.c
index 9fffaeacd..c2f00b115 100644
--- a/drivers/watchdog/wdt_dw.c
+++ b/drivers/watchdog/wdt_dw.c
@@ -149,23 +149,7 @@ static struct wdt_driver_api wdt_dw_funcs = {
.reload = wdt_dw_reload,
};
-/* IRQ_CONFIG needs the flags variable declared by IRQ_CONNECT_STATIC */
-IRQ_CONNECT_STATIC(wdt_dw, CONFIG_WDT_DW_IRQ,
- CONFIG_WDT_DW_IRQ_PRI, wdt_dw_isr, 0, 0);
-
-int wdt_dw_init(struct device *dev)
-{
- dev->driver_api = &wdt_dw_funcs;
-
- IRQ_CONFIG(wdt_dw, CONFIG_WDT_DW_IRQ);
- irq_enable(CONFIG_WDT_DW_IRQ);
-
- _wdt_dw_int_unmask();
-
- _wdt_dw_clock_config(dev);
-
- return 0;
-}
+int wdt_dw_init(struct device *dev);
struct wdt_dw_runtime wdt_runtime;
@@ -182,4 +166,18 @@ DECLARE_DEVICE_INIT_CONFIG(wdt, CONFIG_WDT_DW_DRV_NAME,
SYS_DEFINE_DEVICE(wdt, &wdt_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
-struct device *wdt_dw_isr_dev = SYS_GET_DEVICE(wdt);
+int wdt_dw_init(struct device *dev)
+{
+ dev->driver_api = &wdt_dw_funcs;
+
+ irq_connect(CONFIG_WDT_DW_IRQ, CONFIG_WDT_DW_IRQ_PRI, wdt_dw_isr,
+ SYS_GET_DEVICE(wdt), 0);
+ irq_enable(CONFIG_WDT_DW_IRQ);
+
+ _wdt_dw_int_unmask();
+
+ _wdt_dw_clock_config(dev);
+
+ return 0;
+}
+
diff --git a/drivers/watchdog/wdt_qmsi.c b/drivers/watchdog/wdt_qmsi.c
index e06a5905a..15a1cfe2e 100644
--- a/drivers/watchdog/wdt_qmsi.c
+++ b/drivers/watchdog/wdt_qmsi.c
@@ -83,12 +83,10 @@ void wdt_qmsi_isr(void *arg)
qm_wdt_isr_0();
}
-IRQ_CONNECT_STATIC(wdt, CONFIG_WDT_QMSI_IRQ, CONFIG_WDT_QMSI_IRQ_PRI,
- wdt_qmsi_isr, 0, IOAPIC_EDGE | IOAPIC_HIGH);
-
static int init(struct device *dev)
{
- IRQ_CONFIG(wdt, CONFIG_WDT_QMSI_IRQ);
+ irq_connect(CONFIG_WDT_QMSI_IRQ, CONFIG_WDT_QMSI_IRQ_PRI,
+ wdt_qmsi_isr, 0, IOAPIC_EDGE | IOAPIC_HIGH);
/* Unmask watchdog interrupt */
irq_enable(CONFIG_WDT_QMSI_IRQ);
diff --git a/drivers/watchdog/wdt_static_irq_stubs.S b/drivers/watchdog/wdt_static_irq_stubs.S
deleted file mode 100644
index effbb0a0a..000000000
--- a/drivers/watchdog/wdt_static_irq_stubs.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2015, Intel Corportation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#define _ASMLANGUAGE
-
-#include <arch/x86/asm.h>
-#include <drivers/ioapic.h>
-
-#if defined(CONFIG_WDT_DW)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub wdt_dw wdt_dw_isr wdt_dw_isr_dev
-#endif /* CONFIG_IOAPIC */
-#endif
-
-#if defined(CONFIG_WDT_QMSI)
-#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
- ioapic_mkstub wdt wdt_qmsi_isr wdt_qmsi_isr_dev
-#endif /* CONFIG_IOAPIC || CONFIG_MVIC */
-#endif /* CONFIG_WDT_QMSI */
-
-/* externs (internal APIs) */
-
-GTEXT(_IntEnt)
-GTEXT(_IntExit)
diff --git a/include/arch/arc/arch.h b/include/arch/arc/arch.h
index 531613a95..70745b059 100644
--- a/include/arch/arc/arch.h
+++ b/include/arch/arc/arch.h
@@ -56,50 +56,48 @@ extern "C" {
#ifndef _ASMLANGUAGE
+/* internal routine documented in C file, needed by irq_connect() macro */
+extern void _irq_priority_set(unsigned int irq, unsigned int prio);
+
/**
- * @brief Connect a routine to interrupt number
+ * Configure a static interrupt.
*
- * For the device @a device associates IRQ number @a irq with priority
- * @a priority with the interrupt routine @a isr, that receives parameter
- * @a parameter.
- * IRQ connect static is currently not supported in ARC architecture.
- * The macro is defined as empty for code compatibility with other
- * architectures.
+ * All arguments must be computable by the compiler at build time; if this
+ * can't be done use irq_connect_dynamic() instead.
*
- * @param device Device
- * @param i IRQ number
- * @param p IRQ Priority
- * @param h Interrupt Service Routine
- * @param pm ISR parameter
- * @param f IRQ triggering options
+ * Internally this function does a few things:
*
- * @return N/A
- *
- */
-#define IRQ_CONNECT_STATIC(device, i, p, h, pm, f) \
- const unsigned int _##device##_int_priority = (p); \
- struct _IsrTableEntry _CONCAT(_isr_irq, i) \
- __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, i))))) = \
- {pm, h}
-
-/* internal routine documented in C file, needed by IRQ_CONFIG macro */
-extern void _irq_priority_set(unsigned int irq, unsigned int prio);
-
-/**
+ * 1. The enum statement has no effect but forces the compiler to only
+ * accept constant values for the irq_p parameter, very important as the
+ * numerical IRQ line is used to create a named section.
*
- * @brief Configure interrupt for the device
+ * 2. An instance of _IsrTableEntry is created containing the ISR and its
+ * parameter. If you look at how _sw_isr_table is created, each entry in the
+ * array is in its own section named by the IRQ line number. What we are doing
+ * here is to override one of the default entries (which points to the
+ * spurious IRQ handler) with what was supplied here.
*
- * For the selected device, do the neccessary configuration
- * steps to connect and enable the IRQ line with an ISR
- * at the priority requested.
- * @param device - Device name
- * @param i IRQ number
+ * 3. The priority level for the interrupt is configured by a call to
+ * _irq_priority_set()
*
- * @return N/A
+ * @param irq_p IRQ line number
+ * @param priority_p Interrupt priority
+ * @param isr_p Interrupt service routine
+ * @param isr_param_p ISR parameter
+ * @param flags_p IRQ triggering options (currently unused)
*
+ * @return The vector assigned to this interrupt
*/
-#define IRQ_CONFIG(device, i) \
- _irq_priority_set(i, _##device##_int_priority)
+#define irq_connect(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
+({ \
+ enum { IRQ = irq_p }; \
+ static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \
+ __attribute__ ((used)) \
+ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
+ {isr_param_p, isr_p}; \
+ _irq_priority_set(irq_p, priority_p); \
+ irq_p; \
+})
#endif
diff --git a/include/arch/arc/v2/irq.h b/include/arch/arc/v2/irq.h
index 782b5baea..545f051dd 100644
--- a/include/arch/arc/v2/irq.h
+++ b/include/arch/arc/v2/irq.h
@@ -33,7 +33,7 @@ GTEXT(irq_connect)
GTEXT(irq_enable)
GTEXT(irq_disable)
#else
-extern int irq_connect(unsigned int irq,
+extern int irq_connect_dynamic(unsigned int irq,
unsigned int prio,
void (*isr)(void *arg),
void *arg,
diff --git a/include/arch/arm/cortex_m/irq.h b/include/arch/arm/cortex_m/irq.h
index f48d464f0..b86b4e333 100644
--- a/include/arch/arm/cortex_m/irq.h
+++ b/include/arch/arm/cortex_m/irq.h
@@ -29,11 +29,11 @@
#ifdef _ASMLANGUAGE
GTEXT(_IntExit);
-GTEXT(irq_connect)
+GTEXT(irq_connect_dynamic)
GTEXT(irq_enable)
GTEXT(irq_disable)
#else
-extern int irq_connect(unsigned int irq,
+extern int irq_connect_dynamic(unsigned int irq,
unsigned int prio,
void (*isr)(void *arg),
void *arg,
@@ -52,40 +52,49 @@ extern void _IntExit(void);
#define DO_CONCAT(x, y) x ## y
#define CONCAT(x, y) DO_CONCAT(x, y)
+/* internal routine documented in C file, needed by irq_connect() macro */
+extern void _irq_priority_set(unsigned int irq, unsigned int prio);
+
+
/**
+ * Configure a static interrupt.
*
- * @brief Connect a routine to interrupt number
+ * All arguments must be computable by the compiler at build time; if this
+ * can't be done use irq_connect_dynamic() instead.
*
- * For the device @a device associates IRQ number @a irq with priority
- * @a priority with the interrupt routine @a isr, that receives parameter
- * @a parameter
+ * Internally this function does a few things:
*
- * @return N/A
- *
- */
-#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags) \
- const unsigned int _##device##_int_priority = (priority); \
- struct _IsrTableEntry CONCAT(_isr_irq, irq) \
- __attribute__ ((section(TOSTR(CONCAT(.gnu.linkonce.isr_irq, irq))))) = \
- {parameter, isr}
-
-/* internal routine documented in C file, needed by IRQ_CONFIG macro */
-extern void _irq_priority_set(unsigned int irq, unsigned int prio);
-
-/**
+ * 1. The enum statement has no effect but forces the compiler to only
+ * accept constant values for the irq_p parameter, very important as the
+ * numerical IRQ line is used to create a named section.
*
- * @brief Configure interrupt for the device
+ * 2. An instance of _IsrTableEntry is created containing the ISR and its
+ * parameter. If you look at how _sw_isr_table is created, each entry in the
+ * array is in its own section named by the IRQ line number. What we are doing
+ * here is to override one of the default entries (which points to the
+ * spurious IRQ handler) with what was supplied here.
*
- * For the given device do the necessary configuration steps.
- * For ARM platform, set the interrupt priority
+ * 3. The priority level for the interrupt is configured by a call to
+ * _irq_priority_set()
*
- * @param device Device to configure
- * @param irq IRQ number
- * @return N/A
+ * @param irq_p IRQ line number
+ * @param priority_p Interrupt priority
+ * @param isr_p Interrupt service routine
+ * @param isr_param_p ISR parameter
+ * @param flags_p IRQ triggering options (currently unused)
*
+ * @return The vector assigned to this interrupt
*/
-#define IRQ_CONFIG(device, irq) \
- _irq_priority_set(irq, _##device##_int_priority)
+#define irq_connect(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
+({ \
+ enum { IRQ = irq_p }; \
+ static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \
+ __attribute__ ((used)) \
+ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
+ {isr_param_p, isr_p}; \
+ _irq_priority_set(irq_p, priority_p); \
+ irq_p; \
+})
#endif /* _ASMLANGUAGE */
diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h
index 62cfaa231..de75683b7 100644
--- a/include/arch/x86/arch.h
+++ b/include/arch/x86/arch.h
@@ -151,62 +151,133 @@ typedef struct s_isrList {
ISR_LIST __attribute__((section(".intList"))) MK_ISR_NAME(r) = \
{&r, n, p, v, d}
+
/**
- * @brief Connect a routine to interrupt number
+ * Inline assembly code for the interrupt stub
*
- * For the device @a device associates IRQ number @a irq with priority
- * @a priority with the interrupt routine @a isr, that receives parameter
- * @a parameter.
+ * This is the actual assembly code which gets run when the interrupt
+ * is triggered. Due to different calling convention semantics we have
+ * different versions for IAMCU and SYSV.
*
- * @param device Device
- * @param irq IRQ number
- * @param priority IRQ Priority
- * @param isr Interrupt Service Routine
- * @param parameter ISR parameter
- * @param flags IRQ triggering options
+ * For IAMCU case, we call _execute_handler() with the isr and its argument
+ * as parameters.
*
- * @return N/A
+ * For SysV case, we first call _IntEnt to properly enter Zephyr's interrupt
+ * handling context, and then directly call the isr. A jump is done to
+ * _IntExitWithEoi which does EOI to the interrupt controller, restores
+ * context, and finally does 'iret'.
*
+ * This is only intended to be used by the irq_connect() macro.
*/
-#ifdef CONFIG_MVIC
-#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags) \
- extern void *_##device##_##isr##_stub; \
- const uint32_t _##device##_irq_flags = (flags); \
- NANO_CPU_INT_REGISTER(_##device##_##isr##_stub, (irq), \
- ((irq) + 0x20) / 16, (irq) + 0x20, 0)
+#if CONFIG_X86_IAMCU
+#define _IRQ_STUB_ASM \
+ "pushl %%eax\n\t" \
+ "pushl %%edx\n\t" \
+ "pushl %%ecx\n\t" \
+ "movl %[isr], %%eax\n\t" \
+ "movl %[isr_param], %%edx\n\t" \
+ "call _execute_handler\n\t" \
+ "popl %%ecx\n\t" \
+ "popl %%edx\n\t" \
+ "popl %%eax\n\t" \
+ "iret\n\t"
#else
-#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags) \
- extern void *_##device##_##isr##_stub; \
- const uint32_t _##device##_irq_flags = (flags); \
- NANO_CPU_INT_REGISTER(_##device##_##isr##_stub, (irq), (priority), -1, 0)
-#endif
+#define _IRQ_STUB_ASM \
+ "call _IntEnt\n\t" \
+ "pushl %[isr_param]\n\t" \
+ "call %P[isr]\n\t" \
+ "jmp _IntExitWithEoi\n\t"
+#endif /* CONFIG_X86_IAMCU */
-extern unsigned char _irq_to_interrupt_vector[];
/**
- * @brief Convert a statically connected IRQ to its interrupt vector number
+ * Code snippets for populating the vector ID and priority into the intList
*
- * @param irq IRQ number
+ * The 'magic' of static interrupts is accomplished by building up an array
+ * 'intList' at compile time, and the gen_idt tool uses this to create the
+ * actual IDT data structure.
+ *
+ * For controllers like APIC, the vectors in the IDT are not normally assigned
+ * at build time; instead the sentinel value -1 is saved, and gen_idt figures
+ * out the right vector to use based on our priority scheme. Groups of 16
+ * vectors starting at 32 correspond to each priority level.
+ *
+ * On MVIC, the mapping is fixed; the vector to use is just the irq line
+ * number plus 0x20. The priority argument supplied by the user is discarded.
+ *
+ * These macros are only intended to be used by irq_connect() macro.
*/
-#define _IRQ_TO_INTERRUPT_VECTOR(irq) \
- ((unsigned int) _irq_to_interrupt_vector[irq])
+#if CONFIG_MVIC
+#define _PRIORITY_ARG(irq_p, priority_p) ((irq_p + 0x20) / 16)
+#define _VECTOR_ARG(irq_p) (irq_p + 0x20)
+#else
+#define _PRIORITY_ARG(irq_p, priority_p) (priority_p)
+#define _VECTOR_ARG(irq_p) (-1)
+#endif /* CONFIG_MVIC */
/**
+ * Configure a static interrupt.
*
- * @brief Configure interrupt for the device
+ * All arguments must be computable by the compiler at build time; if this
+ * can't be done use irq_connect_dynamic() instead.
*
- * For the given device do the necessary configuration steps.
- * For x86 platform configure APIC and mark interrupt vector allocated
- * @param device Device - not used by macro
- * @param irq IRQ
+ * Internally this function does a few things:
*
- * @return N/A
+ * 1. There is a block of inline assembly which is completely skipped over
+ * at runtime with an initial 'jmp' instruction.
+ *
+ * 2. There is a declaration of the interrupt parameters in the .intList
+ * section, used by gen_idt to create the IDT. This does the same thing
+ * as the NANO_CPU_INT_REGISTER() macro, but is done in assembly as we
+ * need to populate the .fnc member with the address of the assembly
+ * IRQ stub that we generate immediately afterwards.
+ *
+ * 3. The IRQ stub itself is declared. It doesn't get run in the context
+ * of the calling function due to the initial 'jmp' instruction at the
+ * beginning of the assembly block, but a pointer to it gets saved in the IDT.
+ *
+ * 4. _SysIntVecProgram() is called at runtime to set the mapping between
+ * the vector and the IRQ line.
+ *
+ * @param irq_p IRQ line number
+ * @param priority_p Interrupt priority
+ * @param isr_p Interrupt service routine
+ * @param isr_param_p ISR parameter
+ * @param flags_p IRQ triggering options
+ *
+ * @return The vector assigned to this interrupt
+ */
+#define irq_connect(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
+({ \
+ __asm__ __volatile__( \
+ "jmp 2f\n\t" \
+ ".pushsection .intList\n\t" \
+ ".long 1f\n\t" /* ISR_LIST.fnc */ \
+ ".long %P[irq]\n\t" /* ISR_LIST.irq */ \
+ ".long %P[priority]\n\t" /* ISR_LIST.priority */ \
+ ".long %P[vector]\n\t" /* ISR_LIST.vec */ \
+ ".long 0\n\t" /* ISR_LIST.dpl */ \
+ ".popsection\n\t" \
+ "1:\n\t" \
+ _IRQ_STUB_ASM \
+ "2:\n\t" \
+ : \
+ : [isr] "i" (isr_p), \
+ [isr_param] "i" (isr_param_p), \
+ [priority] "i" _PRIORITY_ARG(irq_p, priority_p), \
+ [vector] "i" _VECTOR_ARG(irq_p), \
+ [irq] "i" (irq_p)); \
+ _SysIntVecProgram(_IRQ_TO_INTERRUPT_VECTOR(irq_p), (irq_p), (flags_p)); \
+ _IRQ_TO_INTERRUPT_VECTOR(irq_p); \
+})
+
+extern unsigned char _irq_to_interrupt_vector[];
+/**
+ * @brief Convert a statically connected IRQ to its interrupt vector number
*
+ * @param irq IRQ number
*/
-#define IRQ_CONFIG(device, irq) \
- do { \
- _SysIntVecProgram(_IRQ_TO_INTERRUPT_VECTOR((irq)), (irq), \
- _##device##_irq_flags); \
- } while (0)
+#define _IRQ_TO_INTERRUPT_VECTOR(irq) \
+ ((unsigned int) _irq_to_interrupt_vector[irq])
/**
@@ -378,7 +449,7 @@ typedef void (*NANO_EOI_GET_FUNC) (void *);
#endif /* CONFIG_SSE */
#endif /* CONFIG_FP_SHARING */
-extern int irq_connect(unsigned int irq,
+extern int irq_connect_dynamic(unsigned int irq,
unsigned int priority,
void (*routine)(void *parameter),
void *parameter,
diff --git a/include/drivers/ioapic.h b/include/drivers/ioapic.h
index f32a212f1..c3f741748 100644
--- a/include/drivers/ioapic.h
+++ b/include/drivers/ioapic.h
@@ -46,9 +46,7 @@ extern "C" {
#define IOAPIC_INIT 0x00000500
#define IOAPIC_EXTINT 0x00000700
-#ifdef _ASMLANGUAGE
-#define ioapic_mkstub loapic_mkstub
-#else /* _ASMLANGUAGE */
+#ifndef _ASMLANGUAGE
#include <device.h>
void _ioapic_irq_enable(unsigned int irq);
void _ioapic_irq_disable(unsigned int irq);
diff --git a/include/drivers/loapic.h b/include/drivers/loapic.h
index b24ee2d58..caa2d2979 100644
--- a/include/drivers/loapic.h
+++ b/include/drivers/loapic.h
@@ -54,40 +54,7 @@ extern "C" {
/* Local APIC Vector Table Bits */
#define LOAPIC_LVT_MASKED 0x00010000 /* mask */
-#ifdef _ASMLANGUAGE
-loapic_eoi = (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
-
-#if !defined(CONFIG_X86_IAMCU)
-.macro loapic_mkstub device isr context
-GTEXT(_\()\device\()_\()\isr\()_stub)
-
-SECTION_FUNC(TEXT, _\()\device\()_\()\isr\()_stub)
- call _IntEnt /* Inform kernel interrupt has begun */
- pushl \context /* Push context parameter */
- call \isr /* Call actual interrupt handler */
- jmp _IntExitWithEoi /* Inform kernel interrupt is done */
-.endm
-#else
-
-.macro loapic_mkstub device isr context
-
-GTEXT(_\()\device\()_\()\isr\()_stub)
-
-SECTION_FUNC(TEXT, _\()\device\()_\()\isr\()_stub)
- pushl %eax
- pushl %edx
- pushl %ecx
- movl $\isr, %eax
- movl \context, %edx
- call _execute_handler
- pop %ecx
- pop %edx
- pop %eax
- iret
-.endm
-#endif /* CONFIG_X86_IAMCU */
-
-#else /* _ASMLANGUAGE */
+#ifndef _ASMLANGUAGE
#include <device.h>
extern void _loapic_int_vec_set(unsigned int irq, unsigned int vector);
diff --git a/include/shared_irq.h b/include/shared_irq.h
index 2e0a3af77..e163bad65 100644
--- a/include/shared_irq.h
+++ b/include/shared_irq.h
@@ -38,7 +38,7 @@ struct shared_irq_driver_api {
extern int shared_irq_initialize(struct device *port);
-typedef void (*shared_irq_config_irq_t)(struct device *port);
+typedef void (*shared_irq_config_irq_t)(void);
struct shared_irq_config {
uint32_t irq_num;
diff --git a/kernel/microkernel/k_irq.c b/kernel/microkernel/k_irq.c
index ef8838d6f..74c1fa442 100644
--- a/kernel/microkernel/k_irq.c
+++ b/kernel/microkernel/k_irq.c
@@ -214,11 +214,7 @@ uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority,
return INVALID_VECTOR;
}
- /*
- * NOTE: the comma that seems to be missing is part of the IRQ_STUB
- * definition to abstract the different irq_connect signatures
- */
- irq_obj_ptr->vector = irq_connect(
+ irq_obj_ptr->vector = irq_connect_dynamic(
irq, priority, task_irq_int_handler, (void *)irq_obj_ptr,
flags);
irq_enable(irq);
diff --git a/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c b/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
index 6f6066d87..325ca9c76 100644
--- a/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
+++ b/samples/microkernel/benchmark/footprint/src/microkernel_footprint.c
@@ -158,7 +158,7 @@ void fgTaskEntry(void)
{
#ifdef TEST_max
/* dynamically link in dummy ISR */
- irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr, (void *) 0, 0);
+ irq_connect_dynamic(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr, (void *) 0, 0);
#endif /* TEST_max */
/* note: referencing "func_array" ensures it isn't optimized out */
diff --git a/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c b/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
index af9fd7129..59665aa4e 100644
--- a/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
+++ b/samples/nanokernel/benchmark/footprint/src/nanokernel_footprint.c
@@ -159,7 +159,7 @@ void main(void)
{
#ifdef TEST_max
/* dynamically link in dummy ISR */
- irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
+ irq_connect_dynamic(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
(void *) 0, 0);
#endif /* TEST_max */
#ifndef TEST_min
diff --git a/samples/nanokernel/benchmark/object_footprint/src/nanokernel_objects.c b/samples/nanokernel/benchmark/object_footprint/src/nanokernel_objects.c
index bb0239e67..19a167eae 100644
--- a/samples/nanokernel/benchmark/object_footprint/src/nanokernel_objects.c
+++ b/samples/nanokernel/benchmark/object_footprint/src/nanokernel_objects.c
@@ -147,7 +147,7 @@ void main(void)
#ifdef CONFIG_DYNAMIC_ISR
/* dynamically link in dummy ISR */
- irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
+ irq_connect_dynamic(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
(void *) 0, 0);
#endif
diff --git a/samples/nanokernel/test/test_context/src/README b/samples/nanokernel/test/test_context/src/README
index 016347eb8..459bbee4f 100644
--- a/samples/nanokernel/test/test_context/src/README
+++ b/samples/nanokernel/test/test_context/src/README
@@ -37,9 +37,8 @@ irq_unlock
- Continuation irq_lock: unlock interrupts, loop and verify the tick
count changes.
-irq_connect
- - Used during nanokernel object initialization. Verified when triggering
- an ISR to perform ISR context work.
+irq_offload
+ - Used when triggering an ISR to perform ISR context work.
nanoCpuExcConnect
- Used during nanokernel object initialization. Verified by triggering a
diff --git a/samples/nanokernel/test/test_context/src/context.c b/samples/nanokernel/test/test_context/src/context.c
index 9e3d5468f..8f88057e5 100644
--- a/samples/nanokernel/test/test_context/src/context.c
+++ b/samples/nanokernel/test/test_context/src/context.c
@@ -22,7 +22,7 @@ This module tests the following CPU and thread related routines:
fiber_fiber_start(), task_fiber_start(), fiber_yield(),
sys_thread_self_get(), sys_execution_context_type_get(), nano_cpu_idle(),
irq_lock(), irq_unlock(),
- irq_connect(), nanoCpuExcConnect(),
+ irq_offload(), nanoCpuExcConnect(),
irq_enable(), irq_disable(),
*/