aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-01-22 13:59:32 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-01-29 18:11:55 +0000
commit7efbfd6ff6490fa6b7144cc341eaf282a21fab32 (patch)
tree1b52e0147e16c3b6775cca045f5705fb4b54db7a
parentbab24f22ba4518e640d14765dbd196e7709e1f0e (diff)
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
-rw-r--r--sys/kern/sched_shim.c25
-rw-r--r--sys/sys/sched.h3
2 files changed, 28 insertions, 0 deletions
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;