diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-02-19 19:55:40 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-02-19 19:55:40 +0000 |
commit | 89376b7141edb6f927fb940c27391cda6e67c785 (patch) | |
tree | 57dd01fd9328b879289493ba848ae5c34c607b91 /bsd_eth_drivers/libbsdport/callout.h | |
download | libbsdport-89376b7141edb6f927fb940c27391cda6e67c785.tar.bz2 |
Initial import.initial
Diffstat (limited to 'bsd_eth_drivers/libbsdport/callout.h')
-rw-r--r-- | bsd_eth_drivers/libbsdport/callout.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bsd_eth_drivers/libbsdport/callout.h b/bsd_eth_drivers/libbsdport/callout.h new file mode 100644 index 0000000..3f586bf --- /dev/null +++ b/bsd_eth_drivers/libbsdport/callout.h @@ -0,0 +1,43 @@ +#ifndef _SYS_CALLOUT_H +#define _SYS_CALLOUT_H /* include this to override rtems stack's */ + +/* RTEMS systm.h still declares old timout stuff which is not + * fully compatible with more recent 'callout' functionality. + * + * Also: our struct callout it incompatible with the one + * declared in rtems' sys/callout.h. + * Make sure to include the proper header (first). + */ + +typedef unsigned callout_time_t; + +struct callout { + struct callout *c_next; + struct callout **c_pprev; + void (*c_func)(void*); + void *c_arg; + struct mtx *c_mtx; + callout_time_t c_time; +}; + +/* We cannot stop a callout that's in progress */ + +void +callout_stop(struct callout *c); + +#define callout_drain callout_stop + +void +callout_reset(struct callout *c, int ticks, void (*fn)(void*), void *arg); + +void +callout_init(struct callout *c, int mpsafe); + +void +callout_init_mtx(struct callout *c, struct mtx *m, unsigned flags); + +/* Initialize callout facility [networking must have been initialized already] */ +rtems_id +rtems_callout_initialize(); + +#endif |