Lines Matching refs:key

81 #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized,		      \  argument
83 __func__, (key))
120 long key; // key may be far away from the core kernel under KASLR member
135 long offset = entry->key & ~3L; in jump_entry_key()
137 return (struct static_key *)((unsigned long)&entry->key + offset); in jump_entry_key()
154 return (struct static_key *)((unsigned long)entry->key & ~3UL); in jump_entry_key()
161 return (unsigned long)entry->key & 1UL; in jump_entry_is_branch()
166 return (unsigned long)entry->key & 2UL; in jump_entry_is_init()
172 entry->key |= 2; in jump_entry_set_init()
174 entry->key &= ~2; in jump_entry_set_init()
205 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
207 return arch_static_branch(key, false); in static_key_false()
210 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
212 return !arch_static_branch(key, true); in static_key_true()
227 extern bool static_key_slow_inc(struct static_key *key);
228 extern bool static_key_fast_inc_not_disabled(struct static_key *key);
229 extern void static_key_slow_dec(struct static_key *key);
230 extern bool static_key_slow_inc_cpuslocked(struct static_key *key);
231 extern void static_key_slow_dec_cpuslocked(struct static_key *key);
232 extern int static_key_count(struct static_key *key);
233 extern void static_key_enable(struct static_key *key);
234 extern void static_key_disable(struct static_key *key);
235 extern void static_key_enable_cpuslocked(struct static_key *key);
236 extern void static_key_disable_cpuslocked(struct static_key *key);
258 static __always_inline int static_key_count(struct static_key *key) in static_key_count() argument
260 return raw_atomic_read(&key->enabled); in static_key_count()
268 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
270 if (unlikely_notrace(static_key_count(key) > 0)) in static_key_false()
275 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
277 if (likely_notrace(static_key_count(key) > 0)) in static_key_true()
282 static inline bool static_key_fast_inc_not_disabled(struct static_key *key) in static_key_fast_inc_not_disabled() argument
286 STATIC_KEY_CHECK_USE(key); in static_key_fast_inc_not_disabled()
291 v = atomic_read(&key->enabled); in static_key_fast_inc_not_disabled()
295 } while (!likely(atomic_try_cmpxchg(&key->enabled, &v, v + 1))); in static_key_fast_inc_not_disabled()
298 #define static_key_slow_inc(key) static_key_fast_inc_not_disabled(key) argument
300 static inline void static_key_slow_dec(struct static_key *key) in static_key_slow_dec() argument
302 STATIC_KEY_CHECK_USE(key); in static_key_slow_dec()
303 atomic_dec(&key->enabled); in static_key_slow_dec()
306 #define static_key_slow_inc_cpuslocked(key) static_key_slow_inc(key) argument
307 #define static_key_slow_dec_cpuslocked(key) static_key_slow_dec(key) argument
317 static inline void static_key_enable(struct static_key *key) in static_key_enable() argument
319 STATIC_KEY_CHECK_USE(key); in static_key_enable()
321 if (atomic_read(&key->enabled) != 0) { in static_key_enable()
322 WARN_ON_ONCE(atomic_read(&key->enabled) != 1); in static_key_enable()
325 atomic_set(&key->enabled, 1); in static_key_enable()
328 static inline void static_key_disable(struct static_key *key) in static_key_disable() argument
330 STATIC_KEY_CHECK_USE(key); in static_key_disable()
332 if (atomic_read(&key->enabled) != 1) { in static_key_disable()
333 WARN_ON_ONCE(atomic_read(&key->enabled) != 0); in static_key_disable()
336 atomic_set(&key->enabled, 0); in static_key_disable()
360 struct static_key key; member
364 struct static_key key; member
367 #define STATIC_KEY_TRUE_INIT (struct static_key_true) { .key = STATIC_KEY_INIT_TRUE, }
368 #define STATIC_KEY_FALSE_INIT (struct static_key_false){ .key = STATIC_KEY_INIT_FALSE, }
486 branch = !arch_static_branch(&(x)->key, true); \
488 branch = !arch_static_branch_jump(&(x)->key, true); \
498 branch = arch_static_branch_jump(&(x)->key, false); \
500 branch = arch_static_branch(&(x)->key, false); \
508 #define static_branch_likely(x) likely_notrace(static_key_enabled(&(x)->key))
509 #define static_branch_unlikely(x) unlikely_notrace(static_key_enabled(&(x)->key))
521 #define static_branch_inc(x) static_key_slow_inc(&(x)->key)
522 #define static_branch_dec(x) static_key_slow_dec(&(x)->key)
523 #define static_branch_inc_cpuslocked(x) static_key_slow_inc_cpuslocked(&(x)->key)
524 #define static_branch_dec_cpuslocked(x) static_key_slow_dec_cpuslocked(&(x)->key)
530 #define static_branch_enable(x) static_key_enable(&(x)->key)
531 #define static_branch_disable(x) static_key_disable(&(x)->key)
532 #define static_branch_enable_cpuslocked(x) static_key_enable_cpuslocked(&(x)->key)
533 #define static_branch_disable_cpuslocked(x) static_key_disable_cpuslocked(&(x)->key)