From 8e2d411633cbbb1a3ae9a9513be3a6d6d9a1ae77 Mon Sep 17 00:00:00 2001 From: rrs Date: Sat, 28 Mar 2015 12:50:24 +0000 Subject: 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. --- sys/sys/_callout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/sys/_callout.h') 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 */ }; -- cgit v1.1