x86: arm: Modify IRQ_CONFIG macro to have same signature as ARC
In order to have drivers that are usable cross architecture the
signature for IRQ_CONFIG needs to be the same to avoid #ifdef hell in
the driver code based on architecture.
Update the macro and it usage for existing drivers
Change-Id: I22e142b21d4e984add231d1dbd97020e4823985f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/drivers/bluetooth/uart.c b/drivers/bluetooth/uart.c
index 515ce2c..847e3ba 100644
--- a/drivers/bluetooth/uart.c
+++ b/drivers/bluetooth/uart.c
@@ -257,7 +257,7 @@
uart_irq_rx_disable(uart);
uart_irq_tx_disable(uart);
- IRQ_CONFIG(bluetooth, uart_irq_get(uart));
+ IRQ_CONFIG(bluetooth, uart_irq_get(uart), 0);
irq_enable(uart_irq_get(uart));
/* Drain the fifo */
diff --git a/drivers/console/uart_console.c b/drivers/console/uart_console.c
index 4838c1e..9ee791d 100644
--- a/drivers/console/uart_console.c
+++ b/drivers/console/uart_console.c
@@ -176,7 +176,7 @@
uart_irq_rx_disable(UART_CONSOLE_DEV);
uart_irq_tx_disable(UART_CONSOLE_DEV);
- IRQ_CONFIG(console, uart_irq_get(UART_CONSOLE_DEV));
+ IRQ_CONFIG(console, uart_irq_get(UART_CONSOLE_DEV), 0);
irq_enable(uart_irq_get(UART_CONSOLE_DEV));
/* Drain the fifo */
diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c
index b28f183..0f72e18 100644
--- a/drivers/gpio/gpio_dw.c
+++ b/drivers/gpio/gpio_dw.c
@@ -377,7 +377,7 @@
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(gpio_dw_0, config->irq_num);
+ IRQ_CONFIG(gpio_dw_0, config->irq_num, 0);
irq_enable(config->irq_num);
#elif defined(CONFIG_GPIO_DW_0_IRQ_SHARED)
ARG_UNUSED(config);
@@ -440,7 +440,7 @@
#ifdef CONFIG_GPIO_DW_1_IRQ_DIRECT
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(gpio_dw_1, config->irq_num);
+ IRQ_CONFIG(gpio_dw_1, config->irq_num, 0);
irq_enable(config->irq_num);
#elif defined(CONFIG_GPIO_DW_1_IRQ_SHARED)
ARG_UNUSED(config);
diff --git a/drivers/i2c/i2c_dw.c b/drivers/i2c/i2c_dw.c
index 482a789..d20e549 100644
--- a/drivers/i2c/i2c_dw.c
+++ b/drivers/i2c/i2c_dw.c
@@ -854,7 +854,7 @@
#if defined(CONFIG_I2C_DW_0_IRQ_DIRECT)
ARG_UNUSED(shared_irq_dev);
- IRQ_CONFIG(i2c_dw_0, config->interrupt_vector);
+ IRQ_CONFIG(i2c_dw_0, config->interrupt_vector, 0);
irq_enable(config->interrupt_vector);
#elif defined(CONFIG_I2C_DW_0_IRQ_SHARED)
ARG_UNUSED(config);
diff --git a/drivers/shared_irq/shared_irq.c b/drivers/shared_irq/shared_irq.c
index bd62e81..8462cc0 100644
--- a/drivers/shared_irq/shared_irq.c
+++ b/drivers/shared_irq/shared_irq.c
@@ -151,7 +151,7 @@
{
struct shared_irq_config *config = port->config->config_info;
- IRQ_CONFIG(shared_irq_0, config->irq_num);
+ IRQ_CONFIG(shared_irq_0, config->irq_num, 0);
}
void shared_irq_isr_0(void *unused)
@@ -183,7 +183,7 @@
{
struct shared_irq_config *config = port->config->config_info;
- IRQ_CONFIG(shared_irq_1, config->irq_num);
+ IRQ_CONFIG(shared_irq_1, config->irq_num, 0);
}
void shared_irq_isr_1(void *unused)
diff --git a/drivers/simple/uart.c b/drivers/simple/uart.c
index e431003..61f0fef 100644
--- a/drivers/simple/uart.c
+++ b/drivers/simple/uart.c
@@ -76,7 +76,7 @@
uart_irq_rx_disable(uart);
uart_irq_tx_disable(uart);
- IRQ_CONFIG(uart_simple, uart_irq_get(uart));
+ IRQ_CONFIG(uart_simple, uart_irq_get(uart), 0);
irq_enable(uart_irq_get(uart));
/* Drain the fifo */
diff --git a/drivers/spi/intel_spi.c b/drivers/spi/intel_spi.c
index 0d1f102..b1dd392 100644
--- a/drivers/spi/intel_spi.c
+++ b/drivers/spi/intel_spi.c
@@ -462,7 +462,7 @@
void spi_config_0_irq(struct device *dev)
{
struct spi_intel_config *config = dev->config->config_info;
- IRQ_CONFIG(spi_intel_irq_port_0, config->irq);
+ IRQ_CONFIG(spi_intel_irq_port_0, config->irq, 0);
}
#endif /* CONFIG_SPI_INTEL_PORT_0 */
@@ -505,7 +505,7 @@
void spi_config_1_irq(struct device *dev)
{
struct spi_intel_config *config = dev->config->config_info;
- IRQ_CONFIG(spi_intel_irq_port_1, config->irq);
+ IRQ_CONFIG(spi_intel_irq_port_1, config->irq, 0);
}
#endif /* CONFIG_SPI_INTEL_PORT_1 */
diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c
index 6494c70..2801180 100644
--- a/drivers/timer/hpet.c
+++ b/drivers/timer/hpet.c
@@ -613,7 +613,7 @@
* has to be programmed into the interrupt controller.
*/
- IRQ_CONFIG(hpet, CONFIG_HPET_TIMER_IRQ);
+ IRQ_CONFIG(hpet, CONFIG_HPET_TIMER_IRQ, 0);
/* enable the IRQ in the interrupt controller */
diff --git a/drivers/timer/loapic_timer.c b/drivers/timer/loapic_timer.c
index 2e3c680..28180f6 100644
--- a/drivers/timer/loapic_timer.c
+++ b/drivers/timer/loapic_timer.c
@@ -599,7 +599,7 @@
* still
* has to be programmed into the interrupt controller.
*/
- IRQ_CONFIG(loapic, CONFIG_LOAPIC_TIMER_IRQ);
+ IRQ_CONFIG(loapic, CONFIG_LOAPIC_TIMER_IRQ, 0);
/* Everything has been configured. It is now safe to enable the
* interrupt */
diff --git a/include/arch/arm/cortex_m/irq.h b/include/arch/arm/cortex_m/irq.h
index e791253..a017b8b 100644
--- a/include/arch/arm/cortex_m/irq.h
+++ b/include/arch/arm/cortex_m/irq.h
@@ -83,7 +83,8 @@
* @return N/A
*
*/
-#define IRQ_CONFIG(device, irq) _irq_priority_set(irq, _##device##_int_priority)
+#define IRQ_CONFIG(device, irq, priority) \
+ _irq_priority_set(irq, _##device##_int_priority)
#endif /* _ASMLANGUAGE */
diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h
index d88b63e..494d8fa 100644
--- a/include/arch/x86/arch.h
+++ b/include/arch/x86/arch.h
@@ -173,7 +173,7 @@
* @return N/A
*
*/
-#define IRQ_CONFIG(device, irq) \
+#define IRQ_CONFIG(device, irq, priority) \
do { \
_SysIntVecProgram(_##device##_int_vector, irq); \
_IntVecMarkAllocated(_##device##_int_vector); \