summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-10 01:30:35 +0000
committerjeff <jeff@FreeBSD.org>2008-03-10 01:30:35 +0000
commit171a608f926e73926af2fc965ef9c62416b10fb3 (patch)
tree136f65ae8dbd50fd9969fc33bc4df882f0c53d26 /sys/kern/sched_4bsd.c
parent30b72f7d932ce911a9f7ee248331ef2dcc6e01a6 (diff)
downloadFreeBSD-src-171a608f926e73926af2fc965ef9c62416b10fb3.zip
FreeBSD-src-171a608f926e73926af2fc965ef9c62416b10fb3.tar.gz
- Add a sched_preempt() routine to be called by md code after IPI_PREEMPT is
delivered. - Add a simple implementation to 4bsd.
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index fb74403..834788c 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1244,6 +1244,17 @@ sched_choose(void)
}
void
+sched_preempt(struct thread *td)
+{
+ thread_lock(td);
+ if (td->td_critnest > 1)
+ td->td_owepreempt = 1;
+ else
+ mi_switch(SW_INVOL | SW_PREEMPT, NULL);
+ thread_unlock(td);
+}
+
+void
sched_userret(struct thread *td)
{
/*
OpenPOWER on IntegriCloud