summaryrefslogtreecommitdiffstats
path: root/sys/sys/_callout.h
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2015-03-28 12:50:24 +0000
committerrrs <rrs@FreeBSD.org>2015-03-28 12:50:24 +0000
commit8e2d411633cbbb1a3ae9a9513be3a6d6d9a1ae77 (patch)
treef549ad26e7b3f0719ad8ebb38c56b86cfbeb39dd /sys/sys/_callout.h
parentf9990b7dcc91119bc54bb1064c8fb13c6fe71de7 (diff)
downloadFreeBSD-src-8e2d411633cbbb1a3ae9a9513be3a6d6d9a1ae77.zip
FreeBSD-src-8e2d411633cbbb1a3ae9a9513be3a6d6d9a1ae77.tar.gz
Change the callout to supply -1 to indicate we are not changing
CPU, also add protection against invalid CPU's as well as split c_flags and c_iflags so that if a user plays with the active flag (the one expected to be played with by callers in MPSAFE) without a lock, it won't adversely affect the callout system by causing a corrupt list. This also means that all callers need to use the macros and *not* play with the falgs directly (like netgraph used to). Differential Revision: htts://reviews.freebsd.org/D1894 Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky tested by hiren and netflix. Sponsored by: Netflix Inc.
Diffstat (limited to 'sys/sys/_callout.h')
-rw-r--r--sys/sys/_callout.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/_callout.h b/sys/sys/_callout.h
index e186aec..1ad5f51 100644
--- a/sys/sys/_callout.h
+++ b/sys/sys/_callout.h
@@ -57,7 +57,8 @@ struct callout {
void *c_arg; /* function argument */
void (*c_func)(void *); /* function to call */
struct lock_object *c_lock; /* lock to handle */
- int c_flags; /* state of this entry */
+ int c_flags; /* User State */
+ int c_iflags; /* Internal State */
volatile int c_cpu; /* CPU we're scheduled on */
};
OpenPOWER on IntegriCloud