XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
jump_label.h File Reference
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/cleanup.h>
#include <linux/atomic.h>
#include <linux/bug.h>
Include dependency graph for jump_label.h:

Go to the source code of this file.

Classes

struct  static_key
 
struct  static_key_false
 

Macros

#define STATIC_KEY_CHECK_USE(key)
 
#define static_key_slow_inc(key)   static_key_fast_inc_not_disabled(key)
 
#define static_key_slow_inc_cpuslocked(key)   static_key_slow_inc(key)
 
#define static_key_slow_dec_cpuslocked(key)   static_key_slow_dec(key)
 
#define static_key_enable_cpuslocked(k)   static_key_enable((k))
 
#define static_key_disable_cpuslocked(k)   static_key_disable((k))
 
#define STATIC_KEY_INIT_TRUE   { .enabled = ATOMIC_INIT(1) }
 
#define STATIC_KEY_INIT_FALSE   { .enabled = ATOMIC_INIT(0) }
 
#define STATIC_KEY_INIT   STATIC_KEY_INIT_FALSE
 
#define jump_label_enabled   static_key_enabled
 
#define STATIC_KEY_TRUE_INIT   (struct static_key_true) { .key = STATIC_KEY_INIT_TRUE, }
 
#define STATIC_KEY_FALSE_INIT   (struct static_key_false){ .key = STATIC_KEY_INIT_FALSE, }
 
#define DEFINE_STATIC_KEY_TRUE(name)    struct static_key_true name = STATIC_KEY_TRUE_INIT
 
#define DEFINE_STATIC_KEY_TRUE_RO(name)    struct static_key_true name __ro_after_init = STATIC_KEY_TRUE_INIT
 
#define DECLARE_STATIC_KEY_TRUE(name)    extern struct static_key_true name
 
#define DEFINE_STATIC_KEY_FALSE(name)    struct static_key_false name = STATIC_KEY_FALSE_INIT
 
#define DEFINE_STATIC_KEY_FALSE_RO(name)    struct static_key_false name __ro_after_init = STATIC_KEY_FALSE_INIT
 
#define DECLARE_STATIC_KEY_FALSE(name)    extern struct static_key_false name
 
#define DEFINE_STATIC_KEY_ARRAY_TRUE(name, count)
 
#define DEFINE_STATIC_KEY_ARRAY_FALSE(name, count)
 
#define _DEFINE_STATIC_KEY_1(name)   DEFINE_STATIC_KEY_TRUE(name)
 
#define _DEFINE_STATIC_KEY_0(name)   DEFINE_STATIC_KEY_FALSE(name)
 
#define DEFINE_STATIC_KEY_MAYBE(cfg, name)    __PASTE(_DEFINE_STATIC_KEY_, IS_ENABLED(cfg))(name)
 
#define _DEFINE_STATIC_KEY_RO_1(name)   DEFINE_STATIC_KEY_TRUE_RO(name)
 
#define _DEFINE_STATIC_KEY_RO_0(name)   DEFINE_STATIC_KEY_FALSE_RO(name)
 
#define DEFINE_STATIC_KEY_MAYBE_RO(cfg, name)    __PASTE(_DEFINE_STATIC_KEY_RO_, IS_ENABLED(cfg))(name)
 
#define _DECLARE_STATIC_KEY_1(name)   DECLARE_STATIC_KEY_TRUE(name)
 
#define _DECLARE_STATIC_KEY_0(name)   DECLARE_STATIC_KEY_FALSE(name)
 
#define DECLARE_STATIC_KEY_MAYBE(cfg, name)    __PASTE(_DECLARE_STATIC_KEY_, IS_ENABLED(cfg))(name)
 
#define static_key_enabled(x)
 
#define static_branch_likely(x)   likely_notrace(static_key_enabled(&(x)->key))
 
#define static_branch_unlikely(x)   unlikely_notrace(static_key_enabled(&(x)->key))
 
#define static_branch_maybe(config, x)
 
#define static_branch_inc(x)   static_key_slow_inc(&(x)->key)
 
#define static_branch_dec(x)   static_key_slow_dec(&(x)->key)
 
#define static_branch_inc_cpuslocked(x)   static_key_slow_inc_cpuslocked(&(x)->key)
 
#define static_branch_dec_cpuslocked(x)   static_key_slow_dec_cpuslocked(&(x)->key)
 
#define static_branch_enable(x)   static_key_enable(&(x)->key)
 
#define static_branch_disable(x)   static_key_disable(&(x)->key)
 
#define static_branch_enable_cpuslocked(x)   static_key_enable_cpuslocked(&(x)->key)
 
#define static_branch_disable_cpuslocked(x)   static_key_disable_cpuslocked(&(x)->key)
 

Enumerations

enum  jump_label_type { JUMP_LABEL_NOP = 0 , JUMP_LABEL_JMP }
 

Functions

 DEFINE_LOCK_GUARD_0 (jump_label_lock, jump_label_lock(), jump_label_unlock()) struct static_key_true
 
bool ____wrong_branch_error (void)
 

Variables

bool static_key_initialized
 

Macro Definition Documentation

◆ _DECLARE_STATIC_KEY_0

#define _DECLARE_STATIC_KEY_0 (   name)    DECLARE_STATIC_KEY_FALSE(name)

◆ _DECLARE_STATIC_KEY_1

#define _DECLARE_STATIC_KEY_1 (   name)    DECLARE_STATIC_KEY_TRUE(name)

◆ _DEFINE_STATIC_KEY_0

#define _DEFINE_STATIC_KEY_0 (   name)    DEFINE_STATIC_KEY_FALSE(name)

◆ _DEFINE_STATIC_KEY_1

#define _DEFINE_STATIC_KEY_1 (   name)    DEFINE_STATIC_KEY_TRUE(name)

◆ _DEFINE_STATIC_KEY_RO_0

#define _DEFINE_STATIC_KEY_RO_0 (   name)    DEFINE_STATIC_KEY_FALSE_RO(name)

◆ _DEFINE_STATIC_KEY_RO_1

#define _DEFINE_STATIC_KEY_RO_1 (   name)    DEFINE_STATIC_KEY_TRUE_RO(name)

◆ DECLARE_STATIC_KEY_FALSE

#define DECLARE_STATIC_KEY_FALSE (   name)     extern struct static_key_false name

◆ DECLARE_STATIC_KEY_MAYBE

#define DECLARE_STATIC_KEY_MAYBE (   cfg,
  name 
)     __PASTE(_DECLARE_STATIC_KEY_, IS_ENABLED(cfg))(name)

◆ DECLARE_STATIC_KEY_TRUE

#define DECLARE_STATIC_KEY_TRUE (   name)     extern struct static_key_true name

◆ DEFINE_STATIC_KEY_ARRAY_FALSE

#define DEFINE_STATIC_KEY_ARRAY_FALSE (   name,
  count 
)
Value:
struct static_key_false name[count] = { \
[0 ... (count) - 1] = STATIC_KEY_FALSE_INIT, \
}
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
#define STATIC_KEY_FALSE_INIT
Definition jump_label.h:360
Definition jump_label.h:355

◆ DEFINE_STATIC_KEY_ARRAY_TRUE

#define DEFINE_STATIC_KEY_ARRAY_TRUE (   name,
  count 
)
Value:
struct static_key_true name[count] = { \
[0 ... (count) - 1] = STATIC_KEY_TRUE_INIT, \
}
#define STATIC_KEY_TRUE_INIT
Definition jump_label.h:359

◆ DEFINE_STATIC_KEY_FALSE

#define DEFINE_STATIC_KEY_FALSE (   name)     struct static_key_false name = STATIC_KEY_FALSE_INIT

◆ DEFINE_STATIC_KEY_FALSE_RO

#define DEFINE_STATIC_KEY_FALSE_RO (   name)     struct static_key_false name __ro_after_init = STATIC_KEY_FALSE_INIT

◆ DEFINE_STATIC_KEY_MAYBE

#define DEFINE_STATIC_KEY_MAYBE (   cfg,
  name 
)     __PASTE(_DEFINE_STATIC_KEY_, IS_ENABLED(cfg))(name)

◆ DEFINE_STATIC_KEY_MAYBE_RO

#define DEFINE_STATIC_KEY_MAYBE_RO (   cfg,
  name 
)     __PASTE(_DEFINE_STATIC_KEY_RO_, IS_ENABLED(cfg))(name)

◆ DEFINE_STATIC_KEY_TRUE

#define DEFINE_STATIC_KEY_TRUE (   name)     struct static_key_true name = STATIC_KEY_TRUE_INIT

◆ DEFINE_STATIC_KEY_TRUE_RO

#define DEFINE_STATIC_KEY_TRUE_RO (   name)     struct static_key_true name __ro_after_init = STATIC_KEY_TRUE_INIT

◆ jump_label_enabled

#define jump_label_enabled   static_key_enabled

◆ static_branch_dec

#define static_branch_dec (   x)    static_key_slow_dec(&(x)->key)

◆ static_branch_dec_cpuslocked

#define static_branch_dec_cpuslocked (   x)    static_key_slow_dec_cpuslocked(&(x)->key)

◆ static_branch_disable

#define static_branch_disable (   x)    static_key_disable(&(x)->key)

◆ static_branch_disable_cpuslocked

#define static_branch_disable_cpuslocked (   x)    static_key_disable_cpuslocked(&(x)->key)

◆ static_branch_enable

#define static_branch_enable (   x)    static_key_enable(&(x)->key)

◆ static_branch_enable_cpuslocked

#define static_branch_enable_cpuslocked (   x)    static_key_enable_cpuslocked(&(x)->key)

◆ static_branch_inc

#define static_branch_inc (   x)    static_key_slow_inc(&(x)->key)

◆ static_branch_inc_cpuslocked

#define static_branch_inc_cpuslocked (   x)    static_key_slow_inc_cpuslocked(&(x)->key)

◆ static_branch_likely

#define static_branch_likely (   x)    likely_notrace(static_key_enabled(&(x)->key))

◆ static_branch_maybe

#define static_branch_maybe (   config,
  x 
)
Value:
#define static_branch_unlikely(x)
Definition jump_label.h:501
#define static_branch_likely(x)
Definition jump_label.h:500
#define IS_ENABLED(option)
Definition kconfig.h:80

◆ static_branch_unlikely

#define static_branch_unlikely (   x)    unlikely_notrace(static_key_enabled(&(x)->key))

◆ STATIC_KEY_CHECK_USE

#define STATIC_KEY_CHECK_USE (   key)
Value:
"%s(): static key '%pS' used before call to jump_label_init()", \
__func__, (key))
bool static_key_initialized
#define WARN(cond, fmt,...)
Definition kernel.h:637

◆ static_key_disable_cpuslocked

#define static_key_disable_cpuslocked (   k)    static_key_disable((k))

◆ static_key_enable_cpuslocked

#define static_key_enable_cpuslocked (   k)    static_key_enable((k))

◆ static_key_enabled

#define static_key_enabled (   x)
Value:
({ \
if (!__builtin_types_compatible_p(typeof(*x), struct static_key) && \
!__builtin_types_compatible_p(typeof(*x), struct static_key_true) &&\
!__builtin_types_compatible_p(typeof(*x), struct static_key_false)) \
____wrong_branch_error(); \
static_key_count((struct static_key *)x) > 0; \
})
Definition jump_label.h:86

◆ STATIC_KEY_FALSE_INIT

#define STATIC_KEY_FALSE_INIT   (struct static_key_false){ .key = STATIC_KEY_INIT_FALSE, }

◆ STATIC_KEY_INIT

#define STATIC_KEY_INIT   STATIC_KEY_INIT_FALSE

◆ STATIC_KEY_INIT_FALSE

#define STATIC_KEY_INIT_FALSE   { .enabled = ATOMIC_INIT(0) }

◆ STATIC_KEY_INIT_TRUE

#define STATIC_KEY_INIT_TRUE   { .enabled = ATOMIC_INIT(1) }

◆ static_key_slow_dec_cpuslocked

#define static_key_slow_dec_cpuslocked (   key)    static_key_slow_dec(key)

◆ static_key_slow_inc

#define static_key_slow_inc (   key)    static_key_fast_inc_not_disabled(key)

◆ static_key_slow_inc_cpuslocked

#define static_key_slow_inc_cpuslocked (   key)    static_key_slow_inc(key)

◆ STATIC_KEY_TRUE_INIT

#define STATIC_KEY_TRUE_INIT   (struct static_key_true) { .key = STATIC_KEY_INIT_TRUE, }

Enumeration Type Documentation

◆ jump_label_type

Enumerator
JUMP_LABEL_NOP 
JUMP_LABEL_JMP 

Function Documentation

◆ ____wrong_branch_error()

bool ____wrong_branch_error ( void  )
extern

◆ DEFINE_LOCK_GUARD_0()

DEFINE_LOCK_GUARD_0 ( jump_label_lock  ,
jump_label_lock()  ,
jump_label_unlock()   
)

Variable Documentation

◆ static_key_initialized

bool static_key_initialized
extern