static void stop_other_cpus(void) { ulong_t s = clear_int_flag(); /* fast way to keep CPU from changing */ cpuset_t xcset; CPUSET_ALL_BUT(xcset, CPU->cpu_id); xc_priority(0, 0, 0, CPUSET2BV(xcset), (xc_func_t)mach_cpu_halt); restore_int_flag(s); }
/* * Wrapper for kmdb to capture other CPUs, causing them to enter the debugger. */ void kdi_xc_others(int this_cpu, void (*func)(void)) { extern int IGNORE_KERNEL_PREEMPTION; int save_kernel_preemption; cpuset_t set; if (!xc_initialized) return; save_kernel_preemption = IGNORE_KERNEL_PREEMPTION; IGNORE_KERNEL_PREEMPTION = 1; CPUSET_ALL_BUT(set, this_cpu); xc_priority_common((xc_func_t)func, 0, 0, 0, CPUSET2BV(set)); IGNORE_KERNEL_PREEMPTION = save_kernel_preemption; }