diff options
author | jeff <jeff@FreeBSD.org> | 2008-03-10 01:30:35 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-03-10 01:30:35 +0000 |
commit | 171a608f926e73926af2fc965ef9c62416b10fb3 (patch) | |
tree | 136f65ae8dbd50fd9969fc33bc4df882f0c53d26 /sys/kern/sched_4bsd.c | |
parent | 30b72f7d932ce911a9f7ee248331ef2dcc6e01a6 (diff) | |
download | FreeBSD-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.c | 11 |
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) { /* |