Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_smp.c
Show First 20 Lines • Show All 890 Lines • ▼ Show 20 Lines | smp_rendezvous_cpus_retry(cpuset_t map, | ||||
void (* action_func)(void *), | void (* action_func)(void *), | ||||
void (* teardown_func)(void *), | void (* teardown_func)(void *), | ||||
void (* wait_func)(void *, int), | void (* wait_func)(void *, int), | ||||
struct smp_rendezvous_cpus_retry_arg *arg) | struct smp_rendezvous_cpus_retry_arg *arg) | ||||
{ | { | ||||
int cpu; | int cpu; | ||||
/* | /* | ||||
* Only one CPU to execute on. | |||||
*/ | |||||
if (!smp_started) { | |||||
spinlock_enter(); | |||||
if (setup_func != NULL) | |||||
setup_func(arg); | |||||
if (action_func != NULL) | |||||
action_func(arg); | |||||
if (teardown_func != NULL) | |||||
teardown_func(arg); | |||||
spinlock_exit(); | |||||
return; | |||||
} | |||||
/* | |||||
* Execute an action on all specified CPUs while retrying until they | * Execute an action on all specified CPUs while retrying until they | ||||
* all acknowledge completion. | * all acknowledge completion. | ||||
*/ | */ | ||||
CPU_COPY(&map, &arg->cpus); | CPU_COPY(&map, &arg->cpus); | ||||
for (;;) { | for (;;) { | ||||
smp_rendezvous_cpus( | smp_rendezvous_cpus( | ||||
arg->cpus, | arg->cpus, | ||||
setup_func, | setup_func, | ||||
▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines |