summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-04-11 03:39:48 +0000
committerjeff <jeff@FreeBSD.org>2003-04-11 03:39:48 +0000
commitb7c587c68add47169272d0f64cc0aab58a501b9b (patch)
treef0d99473b4bd0039fc9fa33f327d953a5673ad55 /sys/kern/sched_4bsd.c
parenta033a840068cb5293a714269fd8d0f731259b542 (diff)
downloadFreeBSD-src-b7c587c68add47169272d0f64cc0aab58a501b9b.zip
FreeBSD-src-b7c587c68add47169272d0f64cc0aab58a501b9b.tar.gz
- Catch up with sched api changes.
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c63
1 files changed, 48 insertions, 15 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 3c4f0fe..219405f 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -438,14 +438,14 @@ sched_rr_interval(void)
* run much recently, and to round-robin among other processes.
*/
void
-sched_clock(struct thread *td)
+sched_clock(struct kse *ke)
{
- struct kse *ke;
struct ksegrp *kg;
+ struct thread *td;
+
+ kg = ke->ke_ksegrp;
+ td = ke->ke_thread;
- KASSERT((td != NULL), ("schedclock: null thread pointer"));
- ke = td->td_kse;
- kg = td->td_ksegrp;
ke->ke_sched->ske_cpticks++;
kg->kg_estcpu = ESTCPULIM(kg->kg_estcpu + 1);
if ((kg->kg_estcpu % INVERSE_ESTCPU_WEIGHT) == 0) {
@@ -463,25 +463,52 @@ sched_clock(struct thread *td)
* aggregated all the estcpu into the 'built-in' ksegrp.
*/
void
-sched_exit(struct ksegrp *kg, struct ksegrp *child)
+sched_exit(struct proc *p, struct proc *p1)
+{
+ sched_exit_kse(FIRST_KSE_IN_PROC(p), FIRST_KSE_IN_PROC(p1));
+ sched_exit_ksegrp(FIRST_KSEGRP_IN_PROC(p), FIRST_KSEGRP_IN_PROC(p1));
+ sched_exit_thread(FIRST_THREAD_IN_PROC(p), FIRST_THREAD_IN_PROC(p1));
+}
+
+void
+sched_exit_kse(struct kse *ke, struct kse *child)
+{
+}
+
+void
+sched_exit_ksegrp(struct ksegrp *kg, struct ksegrp *child)
{
kg->kg_estcpu = ESTCPULIM(kg->kg_estcpu + child->kg_estcpu);
}
void
-sched_fork(struct ksegrp *kg, struct ksegrp *child)
+sched_exit_thread(struct thread *td, struct thread *child)
{
- struct kse *ke;
+}
- /*
- * set priority of child to be that of parent.
- * XXXKSE this needs redefining..
- */
+void
+sched_fork(struct proc *p, struct proc *p1)
+{
+ sched_fork_kse(FIRST_KSE_IN_PROC(p), FIRST_KSE_IN_PROC(p1));
+ sched_fork_ksegrp(FIRST_KSEGRP_IN_PROC(p), FIRST_KSEGRP_IN_PROC(p1));
+ sched_fork_thread(FIRST_THREAD_IN_PROC(p), FIRST_THREAD_IN_PROC(p1));
+}
+
+void
+sched_fork_kse(struct kse *ke, struct kse *child)
+{
+ child->ke_sched->ske_cpticks = 0;
+}
+
+void
+sched_fork_ksegrp(struct ksegrp *kg, struct ksegrp *child)
+{
child->kg_estcpu = kg->kg_estcpu;
+}
- /* Set up scheduler specific data */
- ke = FIRST_KSE_IN_KSEGRP(kg);
- ke->ke_sched->ske_cpticks = 0;
+void
+sched_fork_thread(struct thread *td, struct thread *child)
+{
}
void
@@ -491,6 +518,12 @@ sched_nice(struct ksegrp *kg, int nice)
resetpriority(kg);
}
+void
+sched_class(struct ksegrp *kg, int class)
+{
+ kg->kg_pri_class = class;
+}
+
/*
* Adjust the priority of a thread.
* This may include moving the thread within the KSEGRP,
OpenPOWER on IntegriCloud