* units. */
static struct rxevent *
-_rxevent_Post(struct clock *when, struct clock *now, void (*func) (),
+_rxevent_Post(struct clock *when, struct clock *now,
+ void (*func) (struct rxevent *, void *, void *, int),
void *arg, void *arg1, int arg2, int newargs)
{
register struct rxevent *ev, *evqe, *evqpr;
/* Record user defined event state */
ev->eventTime = *when;
- ev->func = func;
+ if (newargs) {
+ ev->func.newfunc = func;
+ } else {
+ ev->func.oldfunc = (void (*)(struct rxevent *, void *, void*))func;
+ }
ev->arg = arg;
ev->arg1 = arg1;
ev->arg2 = arg2;
}
struct rxevent *
-rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
+rxevent_Post(struct clock *when,
+ void (*func) (struct rxevent *, void *, void *),
+ void *arg, void *arg1)
{
struct clock now;
clock_Zero(&now);
- return _rxevent_Post(when, &now, func, arg, arg1, 0, 0);
+ return _rxevent_Post(when, &now,
+ (void (*)(struct rxevent *, void *, void *, int))func,
+ arg, arg1, 0, 0);
}
struct rxevent *
-rxevent_Post2(struct clock *when, void (*func) (), void *arg, void *arg1,
- int arg2)
+rxevent_Post2(struct clock *when,
+ void (*func) (struct rxevent *, void *, void *, int),
+ void *arg, void *arg1, int arg2)
{
struct clock now;
clock_Zero(&now);
}
struct rxevent *
-rxevent_PostNow(struct clock *when, struct clock *now, void (*func) (),
+rxevent_PostNow(struct clock *when, struct clock *now,
+ void (*func) (struct rxevent *, void *, void *),
void *arg, void *arg1)
{
- return _rxevent_Post(when, now, func, arg, arg1, 0, 0);
+ return _rxevent_Post(when, now,
+ (void (*)(struct rxevent *, void *, void *, int))func,
+ arg, arg1, 0, 0);
}
struct rxevent *
-rxevent_PostNow2(struct clock *when, struct clock *now, void (*func) (),
+rxevent_PostNow2(struct clock *when, struct clock *now,
+ void (*func) (struct rxevent *, void *, void *, int),
void *arg, void *arg1, int arg2)
{
return _rxevent_Post(when, now, func, arg, arg1, arg2, 1);
clock_GetTime(&now);
fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %lp, %lp)\n",
(int)now.sec, (int)now.usec, (int)ev->eventTime.sec,
- (int)ev->eventTime.usec, ev->func,
+ (int)ev->eventTime.usec, ev->func.newfunc,
ev->arg);
}
#endif
rxevent_nPosted--;
MUTEX_EXIT(&rxevent_lock);
if (ev->newargs) {
- ev->func(ev, ev->arg, ev->arg1, ev->arg2);
+ ev->func.newfunc(ev, ev->arg, ev->arg1, ev->arg2);
} else {
- ev->func(ev, ev->arg, ev->arg1);
+ ev->func.oldfunc(ev, ev->arg, ev->arg1);
}
MUTEX_ENTER(&rxevent_lock);
queue_Append(&rxevent_free, ev);