summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2000-11-25 06:22:16 +0000
committerjlemon <jlemon@FreeBSD.org>2000-11-25 06:22:16 +0000
commit7f57729d27eabceea7b2d1da8e4daa1aff81d4b1 (patch)
treecc6169b9cadd74990e10fb85cf75f28ebdc92693 /sys/kern/kern_timeout.c
parent534ec06045a1b2160fd3a756ac756a510819841d (diff)
downloadFreeBSD-src-7f57729d27eabceea7b2d1da8e4daa1aff81d4b1.zip
FreeBSD-src-7f57729d27eabceea7b2d1da8e4daa1aff81d4b1.tar.gz
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
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r--sys/kern/kern_timeout.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 72b5302..5576e08 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
OpenPOWER on IntegriCloud