diff options
author | wollman <wollman@FreeBSD.org> | 1999-03-06 04:46:20 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1999-03-06 04:46:20 +0000 |
commit | 430742a1d927c44ffd86c137de1de95c830e3d9f (patch) | |
tree | c3ce6195396f919b5121b6adf1500d29aacefdee /sys/sys/callout.h | |
parent | a8964e24ebd03ab08f920b3909ed954271a750be (diff) | |
download | FreeBSD-src-430742a1d927c44ffd86c137de1de95c830e3d9f.zip FreeBSD-src-430742a1d927c44ffd86c137de1de95c830e3d9f.tar.gz |
Expose a slightly-lower-level interface to timeouts which allows callers
to manage their own memory. Tested on my machine (make buildworld).
I've made analogous changes on the alpha, but don't have a machine
to test.
Not-objected-to by: dg, gibbs
Diffstat (limited to 'sys/sys/callout.h')
-rw-r--r-- | sys/sys/callout.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/sys/callout.h b/sys/sys/callout.h index 57ae78f..ddb830b 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)callout.h 8.2 (Berkeley) 1/21/94 - * $Id: callout.h,v 1.10 1997/12/01 05:45:15 davidg Exp $ + * $Id: callout.h,v 1.11 1998/01/11 00:43:51 phk Exp $ */ #ifndef _SYS_CALLOUT_H_ @@ -55,8 +55,13 @@ struct callout { int c_time; /* ticks to the event */ void *c_arg; /* function argument */ void (*c_func) __P((void *)); /* function to call */ + int c_flags; /* state of this entry */ }; +#define CALLOUT_LOCAL_ALLOC 0x0001 /* was allocated from callfree */ +#define CALLOUT_PENDING 0x0002 /* callout is currently active */ +#define CALLOUT_FIRED 0x0004 /* callout has been fired */ + struct callout_handle { struct callout *callout; }; @@ -67,6 +72,14 @@ extern struct callout *callout; extern int ncallout; extern struct callout_tailq *callwheel; extern int callwheelsize, callwheelbits, callwheelmask, softticks; + +#define callout_fired(c) ((c)->c_flags & CALLOUT_FIRED) +void callout_init __P((struct callout *)); +#define callout_pending(c) (((c)->c_flags & CALLOUT_PENDING) ? \ + ((c)->c_time - ticks) : 0) +void callout_reset __P((struct callout *, int, void (*)(void *), void *)); +void callout_stop __P((struct callout *)); + #endif /* KERNEL */ #endif /* _SYS_CALLOUT_H_ */ |