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 <charles.youse@intel.com>
diff --git a/drivers/interrupt_controller/system_apic.c b/drivers/interrupt_controller/system_apic.c
index 0e7ae7f..2b49d96 100644
--- a/drivers/interrupt_controller/system_apic.c
+++ b/drivers/interrupt_controller/system_apic.c
@@ -18,7 +18,12 @@
#include <drivers/sysapic.h>
#include <irq.h>
+#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 afbeffa..7b84cee 100644
--- a/include/drivers/sysapic.h
+++ b/include/drivers/sysapic.h
@@ -18,7 +18,12 @@
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>
+#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 */