diff options
| author | ShengYi Hung <aokblast@FreeBSD.org> | 2026-01-05 16:33:04 +0000 |
|---|---|---|
| committer | ShengYi Hung <aokblast@FreeBSD.org> | 2026-01-16 14:38:12 +0000 |
| commit | 5b61ef94d65a3ddace0082ad31c5d74f62293af6 (patch) | |
| tree | d97065004cac5463696441e13d2c3ba7069c383d | |
| parent | b39662fc388678db2b7b5fa3c900205252d15b3b (diff) | |
smp: add smp_rendezvous_cpu helper function
Reviewed by: olce
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54551
| -rw-r--r-- | sys/kern/subr_smp.c | 13 | ||||
| -rw-r--r-- | sys/sys/smp.h | 8 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 9f5106316018..353a69435971 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -625,6 +625,19 @@ smp_rendezvous_cpus(cpuset_t map, } void +smp_rendezvous_cpu(u_int cpuid, + void (* setup_func)(void *), + void (* action_func)(void *), + void (* teardown_func)(void *), + void *arg) +{ + cpuset_t set; + + CPU_SETOF(cpuid, &set); + smp_rendezvous_cpus(set, setup_func, action_func, teardown_func, arg); +} + +void smp_rendezvous(void (* setup_func)(void *), void (* action_func)(void *), void (* teardown_func)(void *), diff --git a/sys/sys/smp.h b/sys/sys/smp.h index b642a6014f33..fdb69b13c0d4 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -16,6 +16,7 @@ #ifndef LOCORE +#include <sys/types.h> #include <sys/cpuset.h> #include <sys/queue.h> @@ -278,7 +279,12 @@ void smp_rendezvous(void (*)(void *), void (*)(void *), void *arg); void smp_rendezvous_cpus(cpuset_t, - void (*)(void *), + void (*)(void *), + void (*)(void *), + void (*)(void *), + void *arg); +void smp_rendezvous_cpu(u_int, + void (*)(void *), void (*)(void *), void (*)(void *), void *arg); |
