- void (*action_func)(void *),
- void *arg)
-{
- if (!smp_initialized) {
- if (action_func != NULL)
- action_func(arg);
- return;
- }
-
- /* obtain broadcast lock */
- lck_mtx_lock(&mp_bc_lock);
-
- /* set static function pointers */
- mp_bc_action_func = action_func;
- mp_bc_func_arg = arg;
-
- assert_wait((event_t)(uintptr_t)&mp_bc_count, THREAD_UNINT);
-
- /*
- * signal other processors, which will call mp_broadcast_action()
- */
- mp_bc_count = real_ncpus; /* assume max possible active */
- mp_bc_ncpus = mp_cpus_call(CPUMASK_OTHERS, NOSYNC, *mp_broadcast_action, NULL) + 1;
- atomic_decl(&mp_bc_count, real_ncpus - mp_bc_ncpus); /* subtract inactive */
-
- /* call executor function on this cpu */
- mp_broadcast_action(NULL);
-
- /* block for other cpus to have run action_func */
- if (mp_bc_ncpus > 1)
- thread_block(THREAD_CONTINUE_NULL);
- else
- clear_wait(current_thread(), THREAD_AWAKENED);
-
- /* release lock */
- lck_mtx_unlock(&mp_bc_lock);
+ void (*action_func)(void *),
+ void *arg)
+{
+ if (!smp_initialized) {
+ if (action_func != NULL) {
+ action_func(arg);
+ }
+ return;
+ }
+
+ /* obtain broadcast lock */
+ lck_mtx_lock(&mp_bc_lock);
+
+ /* set static function pointers */
+ mp_bc_action_func = action_func;
+ mp_bc_func_arg = arg;
+
+ assert_wait((event_t)(uintptr_t)&mp_bc_count, THREAD_UNINT);
+
+ /*
+ * signal other processors, which will call mp_broadcast_action()
+ */
+ mp_bc_count = real_ncpus; /* assume max possible active */
+ mp_bc_ncpus = mp_cpus_call(CPUMASK_ALL, NOSYNC, *mp_broadcast_action, NULL);
+ atomic_decl(&mp_bc_count, real_ncpus - mp_bc_ncpus); /* subtract inactive */
+
+ /* block for other cpus to have run action_func */
+ if (mp_bc_ncpus > 1) {
+ thread_block(THREAD_CONTINUE_NULL);
+ } else {
+ clear_wait(current_thread(), THREAD_AWAKENED);
+ }
+
+ /* release lock */
+ lck_mtx_unlock(&mp_bc_lock);