From 920e575c03b4817d93424a4ed7bc46a5ed288660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 20 Aug 2011 20:09:32 +0000 Subject: [PATCH] As suggested by Ingo, revert r42648 and apply patch from Alex Smith provided in #7872. Thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42650 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/smp.cpp | 10 ++++++---- src/system/kernel/timer.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/system/kernel/smp.cpp b/src/system/kernel/smp.cpp index d241ed0974..899d81c259 100644 --- a/src/system/kernel/smp.cpp +++ b/src/system/kernel/smp.cpp @@ -1266,14 +1266,15 @@ smp_get_current_cpu(void) void call_all_cpus(void (*func)(void*, int), void* cookie) { + cpu_status state = disable_interrupts(); + // if inter-CPU communication is not yet enabled, use the early mechanism if (!sICIEnabled) { call_all_cpus_early(func, cookie); + restore_interrupts(state); return; } - cpu_status state = disable_interrupts(); - if (smp_get_num_cpus() > 1) { smp_send_broadcast_ici(SMP_MSG_CALL_FUNCTION, (uint32)cookie, 0, 0, (void*)func, SMP_MSG_FLAG_ASYNC); @@ -1289,14 +1290,15 @@ call_all_cpus(void (*func)(void*, int), void* cookie) void call_all_cpus_sync(void (*func)(void*, int), void* cookie) { + cpu_status state = disable_interrupts(); + // if inter-CPU communication is not yet enabled, use the early mechanism if (!sICIEnabled) { call_all_cpus_early(func, cookie); + restore_interrupts(state); return; } - cpu_status state = disable_interrupts(); - if (smp_get_num_cpus() > 1) { smp_send_broadcast_ici(SMP_MSG_CALL_FUNCTION, (uint32)cookie, 0, 0, (void*)func, SMP_MSG_FLAG_SYNC); diff --git a/src/system/kernel/timer.cpp b/src/system/kernel/timer.cpp index 50aed760cc..3f626c9eeb 100644 --- a/src/system/kernel/timer.cpp +++ b/src/system/kernel/timer.cpp @@ -94,7 +94,7 @@ static void per_cpu_real_time_clock_changed(void*, int cpu) { per_cpu_timer_data& cpuData = sPerCPU[cpu]; - InterruptsSpinLocker cpuDataLocker(cpuData.lock); + SpinLocker cpuDataLocker(cpuData.lock); bigtime_t realTimeOffset = rtc_boot_time(); if (realTimeOffset == cpuData.real_time_offset)