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:
parent
b2cbd9f58c
commit
40fb6fca05
1 changed files with 10 additions and 0 deletions
|
@ -133,6 +133,8 @@ static inline void trigger_irq(int irq)
|
||||||
*/
|
*/
|
||||||
static inline void trigger_irq(int vector)
|
static inline void trigger_irq(int vector)
|
||||||
{
|
{
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
#ifdef CONFIG_X2APIC
|
#ifdef CONFIG_X2APIC
|
||||||
x86_write_x2apic(LOAPIC_SELF_IPI, ((VECTOR_MASK & vector)));
|
x86_write_x2apic(LOAPIC_SELF_IPI, ((VECTOR_MASK & vector)));
|
||||||
#else
|
#else
|
||||||
|
@ -144,6 +146,14 @@ static inline void trigger_irq(int vector)
|
||||||
#endif
|
#endif
|
||||||
z_loapic_ipi(cpu_id, LOAPIC_ICR_IPI_TEST, vector);
|
z_loapic_ipi(cpu_id, LOAPIC_ICR_IPI_TEST, vector);
|
||||||
#endif /* CONFIG_X2APIC */
|
#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)
|
#elif defined(CONFIG_ARCH_POSIX)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue