summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2006-10-26 21:42:22 +0000
committerjb <jb@FreeBSD.org>2006-10-26 21:42:22 +0000
commitf82c7997354f95e680341bb8e10136ded5fd15eb (patch)
tree2136d90e7e60f4ef25fe147499787d0e6a155b82 /sys/kern/subr_trap.c
parentb3e38fbc69f126c6cc49a0a6e45096d6c01b7c43 (diff)
downloadFreeBSD-src-f82c7997354f95e680341bb8e10136ded5fd15eb.zip
FreeBSD-src-f82c7997354f95e680341bb8e10136ded5fd15eb.tar.gz
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@
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c12
1 files changed, 12 insertions, 0 deletions
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
OpenPOWER on IntegriCloud