diff options
author | Richard Braun <rbraun@sceen.net> | 2018-04-13 23:06:00 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-04-13 23:06:00 +0200 |
commit | 2ed1292205bcc8d702214a4606dfade008e43cdb (patch) | |
tree | 85ecf78c701d32d6b02aa9ef81f5845884903928 /arch/x86/machine | |
parent | 25b89e773603f7c479b731f82d2d8189e0455fcd (diff) |
x86/lapic: fix inter-process interrupt generation
Make the lapic_ipi function interrupt-safe.
Diffstat (limited to 'arch/x86/machine')
-rw-r--r-- | arch/x86/machine/lapic.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/machine/lapic.c b/arch/x86/machine/lapic.c index 180a1a2..3f6d0c2 100644 --- a/arch/x86/machine/lapic.c +++ b/arch/x86/machine/lapic.c @@ -271,11 +271,17 @@ lapic_ap_setup(void) static void lapic_ipi(uint32_t apic_id, uint32_t icr) { + unsigned long flags; + + cpu_intr_save(&flags); + if ((icr & LAPIC_ICR_DEST_MASK) == 0) { lapic_write(&lapic_map->icr_high, apic_id << LAPIC_DEST_SHIFT); } lapic_write(&lapic_map->icr_low, icr & ~LAPIC_ICR_RESERVED); + + cpu_intr_restore(flags); } static void |