diff options
author | gibbs <gibbs@FreeBSD.org> | 1997-09-21 22:00:25 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1997-09-21 22:00:25 +0000 |
commit | 52ace446d29ab170f74f1db02832f24b01e04f20 (patch) | |
tree | d6afe48cd9d67da6e613d4b0c40b0446ded305f5 /sys/kern/kern_time.c | |
parent | 3579df4d35e102051246eb21aa0d7712fbfb6544 (diff) | |
download | FreeBSD-src-52ace446d29ab170f74f1db02832f24b01e04f20.zip FreeBSD-src-52ace446d29ab170f74f1db02832f24b01e04f20.tar.gz |
init_main.c subr_autoconf.c:
Add support for "interrupt driven configuration hooks".
A component of the kernel can register a hook, most likely
during auto-configuration, and receive a callback once
interrupt services are available. This callback will occur before
the root and dump devices are configured, so the configuration
task can affect the selection of those two devices or complete
any tasks that need to be performed prior to launching init.
System boot is posponed so long as a hook is registered. The
hook owner is responsible for removing the hook once their task
is complete or the system boot can continue.
kern_acct.c kern_clock.c kern_exit.c kern_synch.c kern_time.c:
Change the interface and implementation for the kernel callout
service. The new implemntaion is based on the work of
Adam M. Costello and George Varghese, published in a technical
report entitled "Redesigning the BSD Callout and Timer Facilities".
The interface used in FreeBSD is a little different than the one
outlined in the paper. The new function prototypes are:
struct callout_handle timeout(void (*func)(void *),
void *arg, int ticks);
void untimeout(void (*func)(void *), void *arg,
struct callout_handle handle);
If a client wishes to remove a timeout, it must store the
callout_handle returned by timeout and pass it to untimeout.
The new implementation gives 0(1) insert and removal of callouts
making this interface scale well even for applications that
keep 100s of callouts outstanding.
See the updated timeout.9 man page for more details.
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r-- | sys/kern/kern_time.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 8b68ea0..754849a 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.33 1997/08/26 00:40:04 bde Exp $ + * $Id: kern_time.c,v 1.34 1997/09/02 20:05:49 bde Exp $ */ #include <sys/param.h> @@ -586,10 +586,12 @@ setitimer(p, uap, retval) return (EINVAL); s = splclock(); if (uap->which == ITIMER_REAL) { - untimeout(realitexpire, (caddr_t)p); + if (timerisset(&p->p_realtimer.it_value)) + untimeout(realitexpire, (caddr_t)p, p->p_ithandle); if (timerisset(&aitv.it_value)) { timevaladd(&aitv.it_value, &time); - timeout(realitexpire, (caddr_t)p, hzto(&aitv.it_value)); + p->p_ithandle = timeout(realitexpire, (caddr_t)p, + hzto(&aitv.it_value)); } p->p_realtimer = aitv; } else @@ -628,8 +630,9 @@ realitexpire(arg) timevaladd(&p->p_realtimer.it_value, &p->p_realtimer.it_interval); if (timercmp(&p->p_realtimer.it_value, &time, >)) { - timeout(realitexpire, (caddr_t)p, - hzto(&p->p_realtimer.it_value) - 1); + p->p_ithandle = + timeout(realitexpire, (caddr_t)p, + hzto(&p->p_realtimer.it_value) - 1); splx(s); return; } |