Lines Matching refs:key

85 #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized,		      \  argument
87 __func__, (key))
140 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
142 return arch_static_branch(key, false); in static_key_false()
145 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
147 return !arch_static_branch(key, true); in static_key_true()
162 extern void static_key_slow_inc(struct static_key *key);
163 extern void static_key_slow_dec(struct static_key *key);
164 extern void static_key_slow_inc_cpuslocked(struct static_key *key);
165 extern void static_key_slow_dec_cpuslocked(struct static_key *key);
167 extern int static_key_count(struct static_key *key);
168 extern void static_key_enable(struct static_key *key);
169 extern void static_key_disable(struct static_key *key);
170 extern void static_key_enable_cpuslocked(struct static_key *key);
171 extern void static_key_disable_cpuslocked(struct static_key *key);
192 static inline int static_key_count(struct static_key *key) in static_key_count() argument
194 return atomic_read(&key->enabled); in static_key_count()
204 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
206 if (unlikely(static_key_count(key) > 0)) in static_key_false()
211 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
213 if (likely(static_key_count(key) > 0)) in static_key_true()
218 static inline void static_key_slow_inc(struct static_key *key) in static_key_slow_inc() argument
220 STATIC_KEY_CHECK_USE(key); in static_key_slow_inc()
221 atomic_inc(&key->enabled); in static_key_slow_inc()
224 static inline void static_key_slow_dec(struct static_key *key) in static_key_slow_dec() argument
226 STATIC_KEY_CHECK_USE(key); in static_key_slow_dec()
227 atomic_dec(&key->enabled); in static_key_slow_dec()
230 #define static_key_slow_inc_cpuslocked(key) static_key_slow_inc(key) argument
231 #define static_key_slow_dec_cpuslocked(key) static_key_slow_dec(key) argument
246 static inline void static_key_enable(struct static_key *key) in static_key_enable() argument
248 STATIC_KEY_CHECK_USE(key); in static_key_enable()
250 if (atomic_read(&key->enabled) != 0) { in static_key_enable()
251 WARN_ON_ONCE(atomic_read(&key->enabled) != 1); in static_key_enable()
254 atomic_set(&key->enabled, 1); in static_key_enable()
257 static inline void static_key_disable(struct static_key *key) in static_key_disable() argument
259 STATIC_KEY_CHECK_USE(key); in static_key_disable()
261 if (atomic_read(&key->enabled) != 1) { in static_key_disable()
262 WARN_ON_ONCE(atomic_read(&key->enabled) != 0); in static_key_disable()
265 atomic_set(&key->enabled, 0); in static_key_disable()
289 struct static_key key; member
293 struct static_key key; member
296 #define STATIC_KEY_TRUE_INIT (struct static_key_true) { .key = STATIC_KEY_INIT_TRUE, }
297 #define STATIC_KEY_FALSE_INIT (struct static_key_false){ .key = STATIC_KEY_INIT_FALSE, }
400 branch = !arch_static_branch(&(x)->key, true); \
402 branch = !arch_static_branch_jump(&(x)->key, true); \
412 branch = arch_static_branch_jump(&(x)->key, false); \
414 branch = arch_static_branch(&(x)->key, false); \
422 #define static_branch_likely(x) likely(static_key_enabled(&(x)->key))
423 #define static_branch_unlikely(x) unlikely(static_key_enabled(&(x)->key))
431 #define static_branch_inc(x) static_key_slow_inc(&(x)->key)
432 #define static_branch_dec(x) static_key_slow_dec(&(x)->key)
433 #define static_branch_inc_cpuslocked(x) static_key_slow_inc_cpuslocked(&(x)->key)
434 #define static_branch_dec_cpuslocked(x) static_key_slow_dec_cpuslocked(&(x)->key)
440 #define static_branch_enable(x) static_key_enable(&(x)->key)
441 #define static_branch_disable(x) static_key_disable(&(x)->key)
442 #define static_branch_enable_cpuslocked(x) static_key_enable_cpuslocked(&(x)->key)
443 #define static_branch_disable_cpuslocked(x) static_key_disable_cpuslocked(&(x)->key)