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/vax | |
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/vax')
-rw-r--r-- | sys/arch/vax/vax/machdep.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index c3e616a680f..8c7bde72a14 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.20 1999/12/08 06:50:17 itojun Exp $ */ +/* $OpenBSD: machdep.c,v 1.21 2000/03/23 09:59:56 art Exp $ */ /* $NetBSD: machdep.c,v 1.45 1997/07/26 10:12:49 ragge Exp $ */ /* @@ -60,7 +60,7 @@ #include <sys/mbuf.h> #include <sys/reboot.h> #include <sys/conf.h> -#include <sys/callout.h> +#include <sys/timeout.h> #include <sys/device.h> #include <sys/exec.h> #include <sys/mount.h> @@ -254,13 +254,7 @@ cpu_startup() phys_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, VM_PHYS_SIZE, TRUE); - /* - * Initialize callouts - */ - callfree = callout; - for (i = 1; i < ncallout; i++) - callout[i - 1].c_next = &callout[i]; - callout[i - 1].c_next = NULL; + timeout_init(); printf("avail mem = %d\n", (int)ptoa(cnt.v_free_count)); printf("Using %d buffers containing %d bytes of memory.\n", nbuf, @@ -342,7 +336,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 |