From f82c7997354f95e680341bb8e10136ded5fd15eb Mon Sep 17 00:00:00 2001 From: jb Date: Thu, 26 Oct 2006 21:42:22 +0000 Subject: Make KSE a kernel option, turned on by default in all GENERIC kernel configs except sun4v (which doesn't process signals properly with KSE). Reviewed by: davidxu@ --- sys/kern/subr_trap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys/kern/subr_trap.c') diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index efb6a6e..a6eca02 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -115,11 +115,13 @@ userret(struct thread *td, struct trapframe *frame) PROC_UNLOCK(p); } +#ifdef KSE /* * Do special thread processing, e.g. upcall tweaking and such. */ if (p->p_flag & P_SA) thread_userret(td, frame); +#endif /* * Charge system time if profiling. @@ -147,7 +149,9 @@ ast(struct trapframe *framep) { struct thread *td; struct proc *p; +#ifdef KSE struct ksegrp *kg; +#endif struct rlimit rlim; int sflag; int flags; @@ -159,7 +163,9 @@ ast(struct trapframe *framep) td = curthread; p = td->td_proc; +#ifdef KSE kg = td->td_ksegrp; +#endif CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, p->p_pid, p->p_comm); @@ -170,8 +176,10 @@ ast(struct trapframe *framep) td->td_frame = framep; td->td_pticks = 0; +#ifdef KSE if ((p->p_flag & P_SA) && (td->td_mailbox == NULL)) thread_user_enter(td); +#endif /* * This updates the p_sflag's for the checks below in one @@ -256,7 +264,11 @@ ast(struct trapframe *framep) ktrcsw(1, 1); #endif mtx_lock_spin(&sched_lock); +#ifdef KSE sched_prio(td, kg->kg_user_pri); +#else + sched_prio(td, td->td_user_pri); +#endif mi_switch(SW_INVOL, NULL); mtx_unlock_spin(&sched_lock); #ifdef KTRACE -- cgit v1.1