From e82ac18e526c19effc5dbbde65a9253a41919802 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Sat, 25 Nov 2000 06:22:16 +0000 Subject: Revert the last commit to the callout interface, and add a flag to callout_init() indicating whether the callout is safe or not. Update the callers of callout_init() to reflect the new interface. Okayed by: Jake --- sys/kern/kern_timeout.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sys/kern/kern_timeout.c') diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 72b5302fd32c..5576e0872fc9 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -173,7 +173,7 @@ struct callout_handle timeout(ftn, arg, to_ticks) timeout_t *ftn; void *arg; - register int to_ticks; + int to_ticks; { int s; struct callout *new; @@ -242,12 +242,11 @@ callout_handle_init(struct callout_handle *handle) * callout_deactivate() - marks the callout as having been serviced */ void -_callout_reset(c, to_ticks, ftn, arg, flags) +callout_reset(c, to_ticks, ftn, arg) struct callout *c; int to_ticks; void (*ftn) __P((void *)); void *arg; - int flags; { int s; @@ -265,8 +264,7 @@ _callout_reset(c, to_ticks, ftn, arg, flags) to_ticks = 1; c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING | - (flags & CALLOUT_MPSAFE)); + c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); c->c_func = ftn; c->c_time = ticks + to_ticks; TAILQ_INSERT_TAIL(&callwheel[c->c_time & callwheelmask], @@ -308,10 +306,13 @@ callout_stop(c) } void -callout_init(c) +callout_init(c, mpsafe) struct callout *c; + int mpsafe; { bzero(c, sizeof *c); + if (mpsafe) + c->c_flags |= CALLOUT_MPSAFE; } #ifdef APM_FIXUP_CALLTODO -- cgit v1.2.3