git: 5b61ef94d65a - main - smp: add smp_rendezvous_cpu helper function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 16 Jan 2026 14:39:08 UTC
The branch main has been updated by aokblast:
URL: https://cgit.FreeBSD.org/src/commit/?id=5b61ef94d65a3ddace0082ad31c5d74f62293af6
commit 5b61ef94d65a3ddace0082ad31c5d74f62293af6
Author: ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-01-05 16:33:04 +0000
Commit: ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-01-16 14:38:12 +0000
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
---
sys/kern/subr_smp.c | 13 +++++++++++++
sys/sys/smp.h | 8 +++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
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
@@ -624,6 +624,19 @@ smp_rendezvous_cpus(cpuset_t map,
mtx_unlock_spin(&smp_ipi_mtx);
}
+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 *),
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);