From f6900b5c3b4832f48359fd761b80f8693a6735e8 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 16 Jul 2025 20:44:54 -0400 Subject: kernel: Sort out switch MI/MD switch logic Certain operations dealing with context switches are better off being implemented as machine dependent routines which allows us to be flexible with what we can do, as well as the extra benefit of requiring less workarounds to keep things MI. Signed-off-by: Ian Moffett --- sys/include/sys/sched.h | 3 +-- sys/include/sys/schedvar.h | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/include') diff --git a/sys/include/sys/sched.h b/sys/include/sys/sched.h index f4d99f9..d80483a 100644 --- a/sys/include/sys/sched.h +++ b/sys/include/sys/sched.h @@ -50,9 +50,8 @@ struct sched_stat { void sched_stat(struct sched_stat *statp); void sched_init(void); -void sched_yield(void); -void sched_switch_to(struct trapframe *tf, struct proc *td); +void sched_yield(void); void sched_detach(struct proc *td); __dead void sched_enter(void); diff --git a/sys/include/sys/schedvar.h b/sys/include/sys/schedvar.h index 5ed9f5f..017fcb7 100644 --- a/sys/include/sys/schedvar.h +++ b/sys/include/sys/schedvar.h @@ -60,5 +60,11 @@ struct sched_queue { size_t nthread; }; +struct proc *sched_dequeue_td(void); +void mi_sched_switch(struct proc *from); + +void md_sched_switch(struct trapframe *tf); +void sched_oneshot(bool now); + #endif /* _KERNEL */ #endif /* !_SYS_SCHEDVAR_H_ */ -- cgit v1.2.3