*** sys/callout.h.orig Mon Mar 27 12:04:05 1995 --- sys/callout.h Tue Jul 18 01:54:57 1995 *************** *** 40,53 **** * @(#)callout.h 8.2 (Berkeley) 1/21/94 */ struct callout { struct callout *c_next; /* next callout in queue */ void *c_arg; /* function argument */ void (*c_func) __P((void *)); /* function to call */ int c_time; /* ticks to the event */ }; #ifdef _KERNEL ! struct callout *callfree, *callout, calltodo; int ncallout; ! #endif --- 40,90 ---- * @(#)callout.h 8.2 (Berkeley) 1/21/94 */ + #ifndef _SYS_CALLOUT_H_ + #define _SYS_CALLOUT_H_ + struct callout { struct callout *c_next; /* next callout in queue */ + #ifdef CALLWHEEL + struct callout **c_back; /* pointer back to the ptr */ + /* pointing at this struct */ + struct callout *hash_next; /* next and back pointers */ + struct callout **hash_back; /* for the callhash array */ + /* hash_back is NULL iff this callout is not in the hash table. */ + struct callout_handle { + unsigned long lo, hi; + } handle; /* handle for this callout */ + /* The lowest calloutbits of handle.hi are the */ + /* index into the callout array of this callout. */ + #endif /* CALLWHEEL */ void *c_arg; /* function argument */ void (*c_func) __P((void *)); /* function to call */ int c_time; /* ticks to the event */ + /* With CALLWHEEL, c_time is right shifted by callwheelbits bits. */ }; #ifdef _KERNEL ! struct callout *callfree, *callout; int ncallout; ! #ifndef CALLWHEEL ! struct callout calltodo; ! #else ! int calloutsize, calloutbits, calloutmask; ! struct callout **callwheel; ! int callwheelsize, callwheelbits, callwheelmask; ! struct callout **callhash; ! int callhashsize, callhashbits, callhashmask; ! ! /* ncallout is the number of callout structures in the callout array */ ! /* (they are allocated once at boot-time). */ ! /* calloutsize is the smallest power of 2 at least as large as ncallout. */ ! /* calloutbits is the log base 2 of calloutsize. */ ! /* calloutmask is calloutsize - 1. */ ! /* callwheelsize is the number of entries in the callwheel array. */ ! /* callhashsize is the number of entries in the callhash array. */ ! /* callwheelbits, callwheelmask, callhashbits, and callhashmask follow */ ! /* the same pattern as calloutbits and calloutmask. */ ! ! #endif /* CALLWHEEL */ ! #endif /* _KERNEL */ ! #endif /* _SYS_CALLOUT_H_ */