arch/x86: inline x2APIC EOI

From the Jailhouse days, this has been a function call. That's silly.
We now inline the EOI in the ISR when in x2APIC mode. Also clean up
z_irq_controller_eoi(), so it now uses the inline macros.

Also, we now enable x2APIC on up_squared by default.

Fixes: #17133

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This commit is contained in:
Charles E. Youse 2019-09-11 14:20:49 -04:00 committed by Andrew Boie
commit ee525c2597
4 changed files with 13 additions and 18 deletions

View file

@ -204,10 +204,12 @@ alreadyOnIntStack:
cli /* disable interrupts again */
#endif
#if defined(CONFIG_X2APIC)
call z_x2apic_eoi
#else /* xAPIC EOI */
xorl %eax, %eax
#if defined(CONFIG_X2APIC)
xorl %edx, %edx
movl $(X86_X2APIC_BASE_MSR + (LOAPIC_EOI >> 4)), %ecx
wrmsr
#else /* xAPIC */
movl %eax, (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
#endif

View file

@ -11,3 +11,4 @@ CONFIG_SERIAL=y
CONFIG_UART_NS16550=y
CONFIG_UART_CONSOLE=y
CONFIG_I2C=y
CONFIG_X2APIC=y

View file

@ -12,10 +12,6 @@
#include <arch/cpu.h>
#include <arch/x86/msr.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Local APIC Register Offset */
#define LOAPIC_ID 0x020 /* Local APIC ID Reg */
@ -49,6 +45,10 @@ extern "C" {
#ifndef _ASMLANGUAGE
#ifdef __cplusplus
extern "C" {
#endif
extern void z_loapic_int_vec_set(unsigned int irq, unsigned int vector);
extern void z_loapic_irq_enable(unsigned int irq);
extern void z_loapic_irq_disable(unsigned int irq);
@ -136,10 +136,10 @@ static inline void x86_write_loapic(unsigned int reg, u32_t val)
#endif
}
#endif /* _ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* _ASMLANGUAGE */
#endif /* ZEPHYR_INCLUDE_DRIVERS_LOAPIC_H_ */

View file

@ -26,17 +26,9 @@ void z_irq_controller_irq_config(unsigned int vector, unsigned int irq,
int z_irq_controller_isr_vector_get(void);
#ifdef CONFIG_X2APIC
void z_x2apic_eoi(void);
#endif
static inline void z_irq_controller_eoi(void)
{
#if defined(CONFIG_X2APIC)
z_x2apic_eoi();
#else /* xAPIC */
*(volatile int *)(CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI) = 0;
#endif
x86_write_loapic(LOAPIC_EOI, 0);
}
#endif /* _ASMLANGUAGE */