tests: interrupt: add some nop operations in trigger_irq function.

On X86 platforms, the interrupt trigger method has been changed
from using INT command to using APIC IPI, we need to make sure
the IPI interrupt is handled before do our check, so add some
nop operations.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
This commit is contained in:
Chen Peng1 2022-06-22 13:52:48 +08:00 committed by Carles Cufí
commit 40fb6fca05

View file

@ -133,6 +133,8 @@ static inline void trigger_irq(int irq)
*/
static inline void trigger_irq(int vector)
{
uint8_t i;
#ifdef CONFIG_X2APIC
x86_write_x2apic(LOAPIC_SELF_IPI, ((VECTOR_MASK & vector)));
#else
@ -144,6 +146,14 @@ static inline void trigger_irq(int vector)
#endif
z_loapic_ipi(cpu_id, LOAPIC_ICR_IPI_TEST, vector);
#endif /* CONFIG_X2APIC */
/*
* add some nop operations here to cost some cycles to make sure
* the IPI interrupt is handled before do our check.
*/
for (i = 0; i < 10; i++) {
arch_nop();
}
}
#elif defined(CONFIG_ARCH_POSIX)