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:
parent
155853b39c
commit
ee525c2597
4 changed files with 13 additions and 18 deletions
|
@ -204,10 +204,12 @@ alreadyOnIntStack:
|
||||||
cli /* disable interrupts again */
|
cli /* disable interrupts again */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_X2APIC)
|
|
||||||
call z_x2apic_eoi
|
|
||||||
#else /* xAPIC EOI */
|
|
||||||
xorl %eax, %eax
|
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)
|
movl %eax, (CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@ CONFIG_SERIAL=y
|
||||||
CONFIG_UART_NS16550=y
|
CONFIG_UART_NS16550=y
|
||||||
CONFIG_UART_CONSOLE=y
|
CONFIG_UART_CONSOLE=y
|
||||||
CONFIG_I2C=y
|
CONFIG_I2C=y
|
||||||
|
CONFIG_X2APIC=y
|
||||||
|
|
|
@ -12,10 +12,6 @@
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <arch/x86/msr.h>
|
#include <arch/x86/msr.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Local APIC Register Offset */
|
/* Local APIC Register Offset */
|
||||||
|
|
||||||
#define LOAPIC_ID 0x020 /* Local APIC ID Reg */
|
#define LOAPIC_ID 0x020 /* Local APIC ID Reg */
|
||||||
|
@ -49,6 +45,10 @@ extern "C" {
|
||||||
|
|
||||||
#ifndef _ASMLANGUAGE
|
#ifndef _ASMLANGUAGE
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void z_loapic_int_vec_set(unsigned int irq, unsigned int vector);
|
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_enable(unsigned int irq);
|
||||||
extern void z_loapic_irq_disable(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
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _ASMLANGUAGE */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ASMLANGUAGE */
|
||||||
|
|
||||||
#endif /* ZEPHYR_INCLUDE_DRIVERS_LOAPIC_H_ */
|
#endif /* ZEPHYR_INCLUDE_DRIVERS_LOAPIC_H_ */
|
||||||
|
|
|
@ -26,17 +26,9 @@ void z_irq_controller_irq_config(unsigned int vector, unsigned int irq,
|
||||||
|
|
||||||
int z_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 z_irq_controller_eoi(void)
|
static inline void z_irq_controller_eoi(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_X2APIC)
|
x86_write_loapic(LOAPIC_EOI, 0);
|
||||||
z_x2apic_eoi();
|
|
||||||
#else /* xAPIC */
|
|
||||||
*(volatile int *)(CONFIG_LOAPIC_BASE_ADDRESS + LOAPIC_EOI) = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _ASMLANGUAGE */
|
#endif /* _ASMLANGUAGE */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue