From 4eedf7d35a51501245e38dac0c49eec131ea5041 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 21 May 2014 23:41:28 +0200 Subject: x86/lapic: improve IPI generation --- arch/x86/machine/lapic.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'arch/x86') diff --git a/arch/x86/machine/lapic.c b/arch/x86/machine/lapic.c index a4012b9..e56155b 100644 --- a/arch/x86/machine/lapic.c +++ b/arch/x86/machine/lapic.c @@ -13,9 +13,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * - * TODO Review waits/EOIs. */ #include @@ -271,19 +268,10 @@ lapic_ap_setup(void) static void lapic_ipi(uint32_t apic_id, uint32_t icr) { - uint32_t value; + if ((icr & LAPIC_ICR_DEST_MASK) == 0) + lapic_write(&lapic_map->icr_high, apic_id << LAPIC_DEST_SHIFT); - if ((icr & LAPIC_ICR_DEST_MASK) == 0) { - value = lapic_read(&lapic_map->icr_high); - value &= ~LAPIC_DEST_MASK; - value |= apic_id << LAPIC_DEST_SHIFT; - lapic_write(&lapic_map->icr_high, value); - } - - value = lapic_read(&lapic_map->icr_low); - value &= LAPIC_ICR_RESERVED; - value |= icr; - lapic_write(&lapic_map->icr_low, value); + lapic_write(&lapic_map->icr_low, icr & ~LAPIC_ICR_RESERVED); } static void -- cgit v1.2.3