diff options
author | Richard Braun <rbraun@sceen.net> | 2014-05-21 23:41:28 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-05-21 23:41:28 +0200 |
commit | 4eedf7d35a51501245e38dac0c49eec131ea5041 (patch) | |
tree | 0fa917bbe6f72f44f03cf65764213df251a8e23a /arch/x86/machine/lapic.c | |
parent | 870db113f5373cd916016086a5244f399912def4 (diff) |
x86/lapic: improve IPI generation
Diffstat (limited to 'arch/x86/machine/lapic.c')
-rw-r--r-- | arch/x86/machine/lapic.c | 18 |
1 files changed, 3 insertions, 15 deletions
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 <http://www.gnu.org/licenses/>. - * - * - * TODO Review waits/EOIs. */ #include <kern/init.h> @@ -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 |