Lines Matching refs:key

81 #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized,		      \  argument
83 __func__, (key))
125 long key; // key may be far away from the core kernel under KASLR member
140 long offset = entry->key & ~3L; in jump_entry_key()
142 return (struct static_key *)((unsigned long)&entry->key + offset); in jump_entry_key()
159 return (struct static_key *)((unsigned long)entry->key & ~3UL); in jump_entry_key()
166 return (unsigned long)entry->key & 1UL; in jump_entry_is_branch()
171 return (unsigned long)entry->key & 2UL; in jump_entry_is_init()
176 entry->key |= 2; in jump_entry_set_init()
198 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
200 return arch_static_branch(key, false); in static_key_false()
203 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
205 return !arch_static_branch(key, true); in static_key_true()
222 extern void static_key_slow_inc(struct static_key *key);
223 extern void static_key_slow_dec(struct static_key *key);
224 extern void static_key_slow_inc_cpuslocked(struct static_key *key);
225 extern void static_key_slow_dec_cpuslocked(struct static_key *key);
227 extern int static_key_count(struct static_key *key);
228 extern void static_key_enable(struct static_key *key);
229 extern void static_key_disable(struct static_key *key);
230 extern void static_key_enable_cpuslocked(struct static_key *key);
231 extern void static_key_disable_cpuslocked(struct static_key *key);
252 static inline int static_key_count(struct static_key *key) in static_key_count() argument
254 return atomic_read(&key->enabled); in static_key_count()
262 static __always_inline bool static_key_false(struct static_key *key) in static_key_false() argument
264 if (unlikely(static_key_count(key) > 0)) in static_key_false()
269 static __always_inline bool static_key_true(struct static_key *key) in static_key_true() argument
271 if (likely(static_key_count(key) > 0)) in static_key_true()
276 static inline void static_key_slow_inc(struct static_key *key) in static_key_slow_inc() argument
278 STATIC_KEY_CHECK_USE(key); in static_key_slow_inc()
279 atomic_inc(&key->enabled); in static_key_slow_inc()
282 static inline void static_key_slow_dec(struct static_key *key) in static_key_slow_dec() argument
284 STATIC_KEY_CHECK_USE(key); in static_key_slow_dec()
285 atomic_dec(&key->enabled); in static_key_slow_dec()
288 #define static_key_slow_inc_cpuslocked(key) static_key_slow_inc(key) argument
289 #define static_key_slow_dec_cpuslocked(key) static_key_slow_dec(key) argument
304 static inline void static_key_enable(struct static_key *key) in static_key_enable() argument
306 STATIC_KEY_CHECK_USE(key); in static_key_enable()
308 if (atomic_read(&key->enabled) != 0) { in static_key_enable()
309 WARN_ON_ONCE(atomic_read(&key->enabled) != 1); in static_key_enable()
312 atomic_set(&key->enabled, 1); in static_key_enable()
315 static inline void static_key_disable(struct static_key *key) in static_key_disable() argument
317 STATIC_KEY_CHECK_USE(key); in static_key_disable()
319 if (atomic_read(&key->enabled) != 1) { in static_key_disable()
320 WARN_ON_ONCE(atomic_read(&key->enabled) != 0); in static_key_disable()
323 atomic_set(&key->enabled, 0); in static_key_disable()
347 struct static_key key; member
351 struct static_key key; member
354 #define STATIC_KEY_TRUE_INIT (struct static_key_true) { .key = STATIC_KEY_INIT_TRUE, }
355 #define STATIC_KEY_FALSE_INIT (struct static_key_false){ .key = STATIC_KEY_INIT_FALSE, }
458 branch = !arch_static_branch(&(x)->key, true); \
460 branch = !arch_static_branch_jump(&(x)->key, true); \
470 branch = arch_static_branch_jump(&(x)->key, false); \
472 branch = arch_static_branch(&(x)->key, false); \
480 #define static_branch_likely(x) likely(static_key_enabled(&(x)->key))
481 #define static_branch_unlikely(x) unlikely(static_key_enabled(&(x)->key))
489 #define static_branch_inc(x) static_key_slow_inc(&(x)->key)
490 #define static_branch_dec(x) static_key_slow_dec(&(x)->key)
491 #define static_branch_inc_cpuslocked(x) static_key_slow_inc_cpuslocked(&(x)->key)
492 #define static_branch_dec_cpuslocked(x) static_key_slow_dec_cpuslocked(&(x)->key)
498 #define static_branch_enable(x) static_key_enable(&(x)->key)
499 #define static_branch_disable(x) static_key_disable(&(x)->key)
500 #define static_branch_enable_cpuslocked(x) static_key_enable_cpuslocked(&(x)->key)
501 #define static_branch_disable_cpuslocked(x) static_key_disable_cpuslocked(&(x)->key)