diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/cpu/x86/lapic.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index a3d0fcbf89..1db0ff46d1 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -29,10 +29,15 @@ static inline void xapic_write_atomic(unsigned long reg, uint32_t v) : : "memory", "cc"); } +static __always_inline void xapic_send_ipi(uint32_t icrlow, uint32_t apicid) +{ + xapic_write_atomic(LAPIC_ICR2, SET_LAPIC_DEST_FIELD(apicid)); + xapic_write_atomic(LAPIC_ICR, icrlow); +} + #define lapic_read_around(x) lapic_read(x) #define lapic_write_around(x, y) xapic_write_atomic((x), (y)) - static __always_inline uint32_t x2apic_read(unsigned int reg) { uint32_t value, index; @@ -111,6 +116,14 @@ static __always_inline void lapic_update32(unsigned int reg, uint32_t mask, uint } } +static __always_inline void lapic_send_ipi(uint32_t icrlow, uint32_t apicid) +{ + if (is_x2apic_mode()) + x2apic_send_ipi(icrlow, apicid); + else + xapic_send_ipi(icrlow, apicid); +} + static __always_inline void lapic_wait_icr_idle(void) { do { } while (lapic_read(LAPIC_ICR) & LAPIC_ICR_BUSY); |