From cbb74d4e2f4b3140ca4383aded94773c1f45b000 Mon Sep 17 00:00:00 2001 From: "Charles E. Youse" Date: Tue, 1 Oct 2019 19:04:01 -0400 Subject: [PATCH] drivers/interrupt_controller/system_apic.c: remove dependence on IOAPIC system_apic.c assumed that both a local APIC and I/O APIC are in use. This caused compilation failures when the local APIC is enabled but no I/O APIC is present (or configured). Fix preprocessor macros to allow this configuration. Signed-off-by: Charles E. Youse --- drivers/interrupt_controller/system_apic.c | 5 +++++ include/drivers/sysapic.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/interrupt_controller/system_apic.c b/drivers/interrupt_controller/system_apic.c index 0e7ae7f4ab71..2b49d9643d8d 100644 --- a/drivers/interrupt_controller/system_apic.c +++ b/drivers/interrupt_controller/system_apic.c @@ -18,7 +18,12 @@ #include #include +#ifdef CONFIG_IOAPIC #define IS_IOAPIC_IRQ(irq) (irq < LOAPIC_IRQ_BASE) +#else +#define IS_IOAPIC_IRQ(irq) 0 +#endif + #define HARDWARE_IRQ_LIMIT ((LOAPIC_IRQ_BASE + LOAPIC_IRQ_COUNT) - 1) /** diff --git a/include/drivers/sysapic.h b/include/drivers/sysapic.h index afbeffa6d901..7b84cee6c0ee 100644 --- a/include/drivers/sysapic.h +++ b/include/drivers/sysapic.h @@ -18,7 +18,12 @@ #ifndef _ASMLANGUAGE #include +#ifdef CONFIG_IOAPIC #define LOAPIC_IRQ_BASE CONFIG_IOAPIC_NUM_RTES +#else +#define LOAPIC_IRQ_BASE 0 +#endif + #define LOAPIC_IRQ_COUNT 6 /* Default to LOAPIC_TIMER to LOAPIC_ERROR */ /* irq_controller.h interface */