git: 7efbfd6ff649 - main - kern/sched_shim.c: provide required SYSINIT hooks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jan 2026 18:12:26 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=7efbfd6ff6490fa6b7144cc341eaf282a21fab32
commit 7efbfd6ff6490fa6b7144cc341eaf282a21fab32
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-22 13:59:32 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-29 18:11:55 +0000
kern/sched_shim.c: provide required SYSINIT hooks
Reviewed by: olce
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54831
---
sys/kern/sched_shim.c | 25 +++++++++++++++++++++++++
sys/sys/sched.h | 3 +++
2 files changed, 28 insertions(+)
diff --git a/sys/kern/sched_shim.c b/sys/kern/sched_shim.c
index 2dbb6b928961..96c824745815 100644
--- a/sys/kern/sched_shim.c
+++ b/sys/kern/sched_shim.c
@@ -139,5 +139,30 @@ schedinit(void)
active_sched->init();
}
+static void
+sched_setup(void *dummy)
+{
+ active_sched->setup();
+}
+SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL);
+
+static void
+sched_initticks(void *dummy)
+{
+ active_sched->initticks();
+}
+SYSINIT(sched_initticks, SI_SUB_CLOCKS, SI_ORDER_THIRD, sched_initticks,
+ NULL);
+
+static void
+sched_schedcpu(void)
+{
+ active_sched->schedcpu();
+}
+SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, sched_schedcpu, NULL);
+
+SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+ "Scheduler");
+
SYSCTL_STRING(_kern_sched, OID_AUTO, name, CTLFLAG_RD, sched_name, 0,
"Scheduler name");
diff --git a/sys/sys/sched.h b/sys/sys/sched.h
index 27d0fc7d0c8d..c8491ede01a0 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -284,6 +284,9 @@ struct sched_instance {
void (*clear_tdname)(struct thread *td);
void (*init)(void);
void (*init_ap)(void);
+ void (*setup)(void);
+ void (*initticks)(void);
+ void (*schedcpu)(void);
};
extern const struct sched_instance *active_sched;