diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-03-23 09:59:58 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-03-23 09:59:58 +0000 |
commit | e4ca293f2b7880e155199a51cd0ccc792fa720e0 (patch) | |
tree | 6dc58c76d2eaaa482951d8cf4cf7855a14281d96 /sys/arch/i386 | |
parent | d66e702367cad6ad4bdb3038f6f500811c97dc6e (diff) |
New API for timeouts. Replaces the old timeout()/untimeout() API and
makes it the callers responsibility to allocate resources for the
timeouts.
This is a KISS implementation and does _not_ solve the problems of slow
handling of a large number of pending timeouts (this will be solved in
future work) (although hardclock is now guarateed to take constant time
for handling of timeouts).
Old timeout() and untimeout() are implemented as wrappers around the new
API and kept for compatibility. They will be removed as soon as all
subsystems are converted to use the new API.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 18910c9448e..7835c4c89d5 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.127 2000/03/16 22:11:03 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.128 2000/03/23 09:59:54 art Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -90,7 +90,7 @@ #include <sys/reboot.h> #include <sys/conf.h> #include <sys/file.h> -#include <sys/callout.h> +#include <sys/timeout.h> #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/msgbuf.h> @@ -388,11 +388,9 @@ cpu_startup() #endif /* - * Initialize callouts + * Initialize timeouts */ - callfree = callout; - for (i = 1; i < ncallout; i++) - callout[i-1].c_next = &callout[i]; + timeout_init(); #if defined(UVM) printf("avail mem = %lu (%uK)\n", ptoa(uvmexp.free), @@ -463,7 +461,7 @@ allocsys(v) #ifdef REAL_CLISTS valloc(cfree, struct cblock, nclist); #endif - valloc(callout, struct callout, ncallout); + valloc(timeouts, struct timeout, ntimeout); #ifdef SYSVSHM valloc(shmsegs, struct shmid_ds, shminfo.shmmni); #endif |