Skip to content

Commit

Permalink
drivers/interrupt_controller/system_apic.c: remove dependence on IOAPIC
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Charles E. Youse authored and nashif committed Oct 3, 2019
1 parent 718e459 commit cbb74d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/interrupt_controller/system_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

/**
Expand Down
5 changes: 5 additions & 0 deletions include/drivers/sysapic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit cbb74d4

Please sign in to comment.