From e4ca293f2b7880e155199a51cd0ccc792fa720e0 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Thu, 23 Mar 2000 09:59:58 +0000 Subject: 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. --- sys/arch/i386/i386/machdep.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/arch/i386') 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 #include #include -#include +#include #include #include #include @@ -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 -- cgit v1.2.3