summaryrefslogtreecommitdiffstats
path: root/sys/sys/callout.h
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-11-19 06:02:32 +0000
committerjake <jake@FreeBSD.org>2000-11-19 06:02:32 +0000
commitf265931038bd5d4784d95756bac9482fea5c237a (patch)
tree011a8ccbfdc24eb4d3ad466439c9241fc3bd25f7 /sys/sys/callout.h
parent9c6b4db333692ded21cd0e118ef680cefb97d0d4 (diff)
downloadFreeBSD-src-f265931038bd5d4784d95756bac9482fea5c237a.zip
FreeBSD-src-f265931038bd5d4784d95756bac9482fea5c237a.tar.gz
- Protect the callout wheel with a separate spin mutex, callout_lock.
- Use the mutex in hardclock to ensure no races between it and softclock. - Make softclock be INTR_MPSAFE and provide a flag, CALLOUT_MPSAFE, which specifies that a callout handler does not need giant. There is still no way to set this flag when regstering a callout. Reviewed by: -smp@, jlemon
Diffstat (limited to 'sys/sys/callout.h')
-rw-r--r--sys/sys/callout.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/callout.h b/sys/sys/callout.h
index c83bf44..a90285f 100644
--- a/sys/sys/callout.h
+++ b/sys/sys/callout.h
@@ -61,6 +61,7 @@ struct callout {
#define CALLOUT_LOCAL_ALLOC 0x0001 /* was allocated from callfree */
#define CALLOUT_ACTIVE 0x0002 /* callout is currently active */
#define CALLOUT_PENDING 0x0004 /* callout is waiting for timeout */
+#define CALLOUT_MPSAFE 0x0008 /* callout handler is mp safe */
struct callout_handle {
struct callout *callout;
@@ -72,6 +73,7 @@ extern struct callout *callout;
extern int ncallout;
extern struct callout_tailq *callwheel;
extern int callwheelsize, callwheelbits, callwheelmask, softticks;
+extern struct mtx callout_lock;
#define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE)
#define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE)
OpenPOWER on IntegriCloud