summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-03-23 09:59:58 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-03-23 09:59:58 +0000
commite4ca293f2b7880e155199a51cd0ccc792fa720e0 (patch)
tree6dc58c76d2eaaa482951d8cf4cf7855a14281d96 /sys/arch
parentd66e702367cad6ad4bdb3038f6f500811c97dc6e (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')
-rw-r--r--sys/arch/alpha/alpha/machdep.c13
-rw-r--r--sys/arch/amiga/amiga/machdep.c12
-rw-r--r--sys/arch/arc/arc/machdep.c15
-rw-r--r--sys/arch/arm32/arm32/machdep.c14
-rw-r--r--sys/arch/atari/atari/machdep.c10
-rw-r--r--sys/arch/hp300/hp300/machdep.c13
-rw-r--r--sys/arch/hppa/hppa/machdep.c13
-rw-r--r--sys/arch/i386/i386/machdep.c12
-rw-r--r--sys/arch/kbus/kbus/machdep.c10
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c12
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c13
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c13
-rw-r--r--sys/arch/pc532/pc532/machdep.c10
-rw-r--r--sys/arch/pmax/pmax/machdep.c11
-rw-r--r--sys/arch/powerpc/powerpc/machdep.c12
-rw-r--r--sys/arch/sparc/sparc/machdep.c13
-rw-r--r--sys/arch/sun3/sun3/machdep.c13
-rw-r--r--sys/arch/vax/vax/machdep.c14
-rw-r--r--sys/arch/wgrisc/wgrisc/machdep.c17
19 files changed, 92 insertions, 148 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index e80f92db679..1cb6f85bb26 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.31 2000/02/22 19:27:40 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.32 2000/03/23 09:59:52 art Exp $ */
/* $NetBSD: machdep.c,v 1.61 1996/12/07 01:54:49 cgd Exp $ */
/*
@@ -42,7 +42,7 @@
#ifdef REAL_CLISTS
#include <sys/clist.h>
#endif
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -456,7 +456,7 @@ unknown_cputype:
#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
@@ -702,12 +702,9 @@ cpu_startup()
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#if defined(DEBUG)
pmapdebug = opmapdebug;
diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c
index 7aabe71fc55..b8a3b324583 100644
--- a/sys/arch/amiga/amiga/machdep.c
+++ b/sys/arch/amiga/amiga/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.36 2000/02/22 19:27:42 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $ */
/* $NetBSD: machdep.c,v 1.95 1997/08/27 18:31:17 is Exp $ */
/*
@@ -54,7 +54,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -362,7 +362,7 @@ again:
#define valloclim(name, type, num, lim) \
(name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
/* valloc(cfree, struct cblock, nclist); */
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
@@ -479,11 +479,9 @@ again:
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i - 1].c_next = &callout[i];
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c
index f991f33ae9c..a9115abc7b5 100644
--- a/sys/arch/arc/arc/machdep.c
+++ b/sys/arch/arc/arc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */
+/* $OpenBSD: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
- * $Id: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $
+ * $Id: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $
*/
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -54,7 +54,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -482,7 +482,7 @@ mips_init(argc, argv, envv)
#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
@@ -818,12 +818,9 @@ cpu_startup()
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
diff --git a/sys/arch/arm32/arm32/machdep.c b/sys/arch/arm32/arm32/machdep.c
index 91c7331ee35..812d0aedcfc 100644
--- a/sys/arch/arm32/arm32/machdep.c
+++ b/sys/arch/arm32/arm32/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.5 1999/05/22 21:22:20 weingart Exp $ */
+/* $OpenBSD: machdep.c,v 1.6 2000/03/23 09:59:53 art Exp $ */
/* $NetBSD: machdep.c,v 1.6 1996/03/13 21:32:39 mark Exp $ */
/*
@@ -50,7 +50,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/reboot.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/kernel.h>
@@ -1368,13 +1368,9 @@ cpu_startup()
*/
/*
- * Initialise callouts
+ * Initialise timeouts
*/
-
- callfree = callout;
-
- for (loop = 1; loop < ncallout; ++loop)
- callout[loop - 1].c_next = &callout[loop];
+ timeout_init();
printf("avail mem = %d (%d pages)\n", (int)ptoa(cnt.v_free_count),
(int)ptoa(cnt.v_free_count) / NBPG);
@@ -1471,7 +1467,7 @@ allocsys(v)
(caddr_t)(name) = (type *)v; \
v = (caddr_t)((name) + (num));
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
diff --git a/sys/arch/atari/atari/machdep.c b/sys/arch/atari/atari/machdep.c
index 2ead98665bd..fce889d2bf7 100644
--- a/sys/arch/atari/atari/machdep.c
+++ b/sys/arch/atari/atari/machdep.c
@@ -53,7 +53,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -213,7 +213,7 @@ again:
#define valloclim(name, type, num, lim) \
(name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
/* valloc(cfree, struct cblock, nclist); */
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
@@ -327,11 +327,9 @@ again:
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index 170b07c5137..a6b85a3c25d 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.39 2000/02/22 19:27:46 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.40 2000/03/23 09:59:54 art Exp $ */
/* $NetBSD: machdep.c,v 1.94 1997/06/12 15:46:29 mrg Exp $ */
/*
@@ -48,7 +48,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/clist.h>
#include <sys/conf.h>
#include <sys/exec.h>
@@ -320,12 +320,9 @@ cpu_startup()
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
@@ -400,7 +397,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
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 48facbcf808..c972583aae3 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.23 2000/03/16 22:11:03 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.24 2000/03/23 09:59:54 art Exp $ */
/*
* Copyright (c) 1999-2000 Michael Shalayeff
@@ -44,7 +44,7 @@
#include <sys/device.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>
@@ -310,7 +310,7 @@ hppa_init(start)
valloc(cfree, struct cblock, nclist);
#endif
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
valloc(buf, struct buf, nbuf);
#ifdef SYSVSHM
@@ -525,12 +525,9 @@ cpu_startup()
VM_MBUF_SIZE, VM_MAP_INTRSAFE, FALSE, NULL);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
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
diff --git a/sys/arch/kbus/kbus/machdep.c b/sys/arch/kbus/kbus/machdep.c
index 03bb797b874..390f9e83f79 100644
--- a/sys/arch/kbus/kbus/machdep.c
+++ b/sys/arch/kbus/kbus/machdep.c
@@ -54,7 +54,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>
@@ -460,11 +460,9 @@ cpu_startup(void)
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
+ timeout_init();
printf("avail mem = 0x%x\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
@@ -504,7 +502,7 @@ allocsys(v)
(name) = (type *)v; v = (caddr_t)((name)+(num))
#define valloclim(name, type, num, lim) \
(name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index 88f09533e26..9fb3112faf4 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.65 2000/02/22 19:27:52 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.66 2000/03/23 09:59:54 art Exp $ */
/* $NetBSD: machdep.c,v 1.134 1997/02/14 06:15:30 scottr Exp $ */
/*
@@ -93,7 +93,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -363,7 +363,7 @@ again:
#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
@@ -479,11 +479,9 @@ again:
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i - 1].c_next = &callout[i];
+ timeout_init();
printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 101d54be691..6ea693627e1 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.32 2000/02/22 19:27:54 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.33 2000/03/23 09:59:55 art Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -83,7 +83,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -296,7 +296,7 @@ cpu_startup()
#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
@@ -403,12 +403,9 @@ cpu_startup()
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 700140a76ba..e0b04f9cb5e 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.19 2000/02/22 19:27:55 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.20 2000/03/23 09:59:55 art Exp $ */
/*
* Copyright (c) 1998, 1999 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -55,7 +55,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/mount.h>
@@ -636,12 +636,9 @@ cpu_startup()
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- 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", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
@@ -700,7 +697,7 @@ register caddr_t v;
#ifdef REAL_CLISTS
valloc(cfree, struct cblock, nclist);
#endif
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#if 0
valloc(swapmap, struct map, nswapmap = maxproc * 2);
#endif
diff --git a/sys/arch/pc532/pc532/machdep.c b/sys/arch/pc532/pc532/machdep.c
index 9462904d85d..eb26828fb67 100644
--- a/sys/arch/pc532/pc532/machdep.c
+++ b/sys/arch/pc532/pc532/machdep.c
@@ -56,7 +56,7 @@ static char rcsid[] = "/b/source/CVS/src/sys/arch/pc532/pc532/machdep.c,v 1.2 19
#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>
@@ -349,7 +349,7 @@ again:
(name) = (type *)v; v = (caddr_t)((name)+(num))
#define valloclim(name, type, num, lim) \
(name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
@@ -460,11 +460,9 @@ again:
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
+ timeout_init();
printf("avail mem = 0x%x\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c
index 29a7914ed30..2ae10f121da 100644
--- a/sys/arch/pmax/pmax/machdep.c
+++ b/sys/arch/pmax/pmax/machdep.c
@@ -54,7 +54,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -700,7 +700,7 @@ mach_init(argc, argv, code, cv)
#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
@@ -856,12 +856,9 @@ cpu_startup()
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
diff --git a/sys/arch/powerpc/powerpc/machdep.c b/sys/arch/powerpc/powerpc/machdep.c
index 50d6b0c693e..7a3e6a65b96 100644
--- a/sys/arch/powerpc/powerpc/machdep.c
+++ b/sys/arch/powerpc/powerpc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.35 2000/03/23 04:01:55 rahnds Exp $ */
+/* $OpenBSD: machdep.c,v 1.36 2000/03/23 09:59:56 art Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -35,7 +35,7 @@
#include <sys/param.h>
#include <sys/buf.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/exec.h>
#include <sys/malloc.h>
#include <sys/map.h>
@@ -515,11 +515,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();
#ifdef UVM
printf("avail mem = %d\n", ptoa(uvmexp.free));
@@ -564,7 +562,7 @@ allocsys(v)
#define valloc(name, type, num) \
v = (caddr_t)(((name) = (type *)v) + (num))
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 8051d02965f..d063046906f 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.47 2000/03/16 22:11:02 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.48 2000/03/23 09:59:56 art Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -58,7 +58,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
@@ -353,12 +353,9 @@ cpu_startup()
VM_MBUF_SIZE, FALSE);
#endif
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- callfree = callout;
- for (i = 1; i < ncallout; i++)
- callout[i-1].c_next = &callout[i];
- callout[i-1].c_next = NULL;
+ timeout_init();
#ifdef DEBUG
pmapdebug = opmapdebug;
@@ -408,7 +405,7 @@ allocsys(v)
#define valloc(name, type, num) \
v = (caddr_t)(((name) = (type *)v) + (num))
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c
index 26d49c789e7..2c48c2c7481 100644
--- a/sys/arch/sun3/sun3/machdep.c
+++ b/sys/arch/sun3/sun3/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.25 2000/03/02 23:02:14 todd Exp $ */
+/* $OpenBSD: machdep.c,v 1.26 2000/03/23 09:59:56 art Exp $ */
/* $NetBSD: machdep.c,v 1.77 1996/10/13 03:47:51 christos Exp $ */
/*
@@ -55,7 +55,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -187,7 +187,7 @@ allocsys(v)
#ifdef REAL_CLISTS
valloc(cfree, struct cblock, nclist);
#endif
- valloc(callout, struct callout, ncallout);
+ valloc(timeouts, struct timeoutout, ntimeout);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
@@ -346,12 +346,9 @@ cpu_startup()
VM_MBUF_SIZE, FALSE);
/*
- * Initialize callouts
+ * Initialize timeouts
*/
- 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 = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
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
diff --git a/sys/arch/wgrisc/wgrisc/machdep.c b/sys/arch/wgrisc/wgrisc/machdep.c
index 7135ba0199c..38f61f10fe8 100644
--- a/sys/arch/wgrisc/wgrisc/machdep.c
+++ b/sys/arch/wgrisc/wgrisc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.5 1999/05/22 21:22:32 weingart Exp $ */
+/* $OpenBSD: machdep.c,v 1.6 2000/03/23 09:59:56 art Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
- * $Id: machdep.c,v 1.5 1999/05/22 21:22:32 weingart Exp $
+ * $Id: machdep.c,v 1.6 2000/03/23 09:59:56 art Exp $
*/
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -54,7 +54,7 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
-#include <sys/callout.h>
+#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
@@ -417,7 +417,7 @@ mips_init(argc, argv, code)
#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
@@ -573,13 +573,8 @@ cpu_startup()
bzero(mclrefcnt, NMBCLUSTERS+CLBYTES/MCLBYTES);
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
- /*
- * 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();
#ifdef DEBUG
pmapdebug = opmapdebug;