From 89376b7141edb6f927fb940c27391cda6e67c785 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 19 Feb 2009 19:55:40 +0000 Subject: Initial import. --- bsd_eth_drivers/libbsdport/callout.h | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bsd_eth_drivers/libbsdport/callout.h (limited to 'bsd_eth_drivers/libbsdport/callout.h') 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 -- cgit v1.2.3