Skip to content
Permalink
Browse files

arch/x86: eliminate include/arch/x86/irq_controller.h

The MVIC is no longer supported, and only the APIC-based interrupt
subsystem remains. Thus this layer of indirection is unnecessary.

This also corrects an oversight left over from the Jailhouse x2APIC
implementation affecting EOI delivery for direct ISRs only.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
  • Loading branch information...
Charles E. Youse authored and nashif committed Jun 28, 2019
1 parent 15dac5b commit 0325a3d972afddc1907ca9bafa590d7018d0e788
@@ -17,7 +17,7 @@
#include <kernel.h>
#include <kernel_structs.h>
#include <sys/printk.h>
#include <arch/x86/irq_controller.h>
#include <drivers/interrupt_controller/sysapic.h>
#include <arch/x86/ia32/segmentation.h>
#include <exception.h>
#include <inttypes.h>
@@ -18,7 +18,7 @@
#include <arch/x86/ia32/asm.h>
#include <offsets_short.h>
#include <arch/cpu.h> /* _NANO_ERR_SPURIOUS_INT */
#include <arch/x86/irq_controller.h>
#include <drivers/interrupt_controller/sysapic.h>

/* exports (internal APIs) */

@@ -210,8 +210,14 @@ alreadyOnIntStack:
cli /* disable interrupts again */
#endif

/* irq_controller.h interface */
_irq_controller_eoi_macro
#if defined(CONFIG_EOI_FORWARDING_BUG)
call z_lakemont_eoi
#elif defined(CONFIG_X2APIC)
call z_x2apic_eoi
#else /* xAPIC EOI */
xorl %eax, %eax
movl %eax, (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
#endif

/* determine whether exiting from a nested interrupt */
movl $_kernel, %ecx
@@ -295,7 +295,7 @@ void z_loapic_irq_disable(unsigned int irq)
* @return The vector of the interrupt that is currently being processed, or -1
* if no IRQ is being serviced.
*/
int __irq_controller_isr_vector_get(void)
int z_irq_controller_isr_vector_get(void)
{
int pReg, block;

@@ -43,7 +43,7 @@
* @param flags interrupt flags
*
*/
void __irq_controller_irq_config(unsigned int vector, unsigned int irq,
void z_irq_controller_irq_config(unsigned int vector, unsigned int irq,
u32_t flags)
{
__ASSERT(irq <= HARDWARE_IRQ_LIMIT, "invalid irq line");
@@ -61,7 +61,6 @@
#include <linker/sections.h>
#include <sys_clock.h>
#include <drivers/timer/system_timer.h>
#include <arch/x86/irq_controller.h>
#include <power/power.h>
#include <device.h>
#include <kernel_structs.h>
@@ -16,7 +16,7 @@

#include <irq.h>
#include "sys_io.h"
#include <arch/x86/irq_controller.h>
#include <drivers/interrupt_controller/sysapic.h>
#include <kernel_arch_thread.h>
#include <generated_dts_board.h>
#include <mmustructs.h>
@@ -193,7 +193,7 @@ typedef struct s_isrList {
* @param priority_p Interrupt priority
* @param isr_p Interrupt service routine
* @param isr_param_p ISR parameter
* @param flags_p IRQ triggering options, as defined in irq_controller.h
* @param flags_p IRQ triggering options, as defined in sysapic.h
*
* @return The vector assigned to this interrupt
*/

This file was deleted.

@@ -9,55 +9,38 @@

#include <drivers/interrupt_controller/loapic.h>

#define _IRQ_TRIGGER_EDGE IOAPIC_EDGE
#define _IRQ_TRIGGER_LEVEL IOAPIC_LEVEL
#define IRQ_TRIGGER_EDGE IOAPIC_EDGE
#define IRQ_TRIGGER_LEVEL IOAPIC_LEVEL

#define _IRQ_POLARITY_HIGH IOAPIC_HIGH
#define _IRQ_POLARITY_LOW IOAPIC_LOW
#define IRQ_POLARITY_HIGH IOAPIC_HIGH
#define IRQ_POLARITY_LOW IOAPIC_LOW

#ifndef _ASMLANGUAGE
#include <zephyr/types.h>

#define LOAPIC_IRQ_BASE CONFIG_IOAPIC_NUM_RTES
#define LOAPIC_IRQ_COUNT 6 /* Default to LOAPIC_TIMER to LOAPIC_ERROR */

/* irq_controller.h interface */
void __irq_controller_irq_config(unsigned int vector, unsigned int irq,
void z_irq_controller_irq_config(unsigned int vector, unsigned int irq,
u32_t flags);

int __irq_controller_isr_vector_get(void);
int z_irq_controller_isr_vector_get(void);

#ifdef CONFIG_X2APIC
void z_x2apic_eoi(void);
#endif

static inline void __irq_controller_eoi(void)
static inline void z_irq_controller_eoi(void)
{
#if CONFIG_EOI_FORWARDING_BUG
#if defined(CONFIG_EOI_FORWARDING_BUG)
z_lakemont_eoi();
#else
#elif defined(CONFIG_X2APIC)
z_x2apic_eoi();
#else /* xAPIC */
*(volatile int *)(CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI) = 0;
#endif
}

#else /* _ASMLANGUAGE */

#if CONFIG_EOI_FORWARDING_BUG
.macro __irq_controller_eoi_macro
call z_lakemont_eoi
.endm
#else
.macro __irq_controller_eoi_macro
#ifdef CONFIG_X2APIC
call z_x2apic_eoi
#else
xorl %eax, %eax /* zeroes eax */
loapic_eoi_reg = (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
movl %eax, loapic_eoi_reg /* tell LOAPIC the IRQ is handled */
#endif
.endm
#endif /* CONFIG_EOI_FORWARDING_BUG */

#endif /* _ASMLANGUAGE */

#endif /* ZEPHYR_INCLUDE_DRIVERS_SYSAPIC_H_ */
@@ -15,7 +15,7 @@
*/

#include <kernel.h>
#include <arch/x86/irq_controller.h>
#include <drivers/interrupt_controller/sysapic.h>
#include <sys/sys_io.h>
#include <interrupt_controller/ioapic_priv.h>

0 comments on commit 0325a3d

Please sign in to comment.
You can’t perform that action at this time.