Skip to content

Commit cbb74d4

Browse files
Charles E. Yousenashif
authored andcommitted
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 <[email protected]>
1 parent 718e459 commit cbb74d4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/interrupt_controller/system_apic.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
#include <drivers/sysapic.h>
1919
#include <irq.h>
2020

21+
#ifdef CONFIG_IOAPIC
2122
#define IS_IOAPIC_IRQ(irq) (irq < LOAPIC_IRQ_BASE)
23+
#else
24+
#define IS_IOAPIC_IRQ(irq) 0
25+
#endif
26+
2227
#define HARDWARE_IRQ_LIMIT ((LOAPIC_IRQ_BASE + LOAPIC_IRQ_COUNT) - 1)
2328

2429
/**

include/drivers/sysapic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
#ifndef _ASMLANGUAGE
1919
#include <zephyr/types.h>
2020

21+
#ifdef CONFIG_IOAPIC
2122
#define LOAPIC_IRQ_BASE CONFIG_IOAPIC_NUM_RTES
23+
#else
24+
#define LOAPIC_IRQ_BASE 0
25+
#endif
26+
2227
#define LOAPIC_IRQ_COUNT 6 /* Default to LOAPIC_TIMER to LOAPIC_ERROR */
2328

2429
/* irq_controller.h interface */

0 commit comments

Comments
 (0)