]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/jump_label.h
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / include / linux / jump_label.h
index 661af564fae8b2662f4fdd8f17557ebc8a443208..b63d6b7b0db0a295432320d432da5005f718a0f2 100644 (file)
@@ -21,6 +21,8 @@
  *
  * DEFINE_STATIC_KEY_TRUE(key);
  * DEFINE_STATIC_KEY_FALSE(key);
+ * DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count);
+ * DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count);
  * static_branch_likely()
  * static_branch_unlikely()
  *
@@ -267,9 +269,25 @@ struct static_key_false {
 #define DEFINE_STATIC_KEY_TRUE(name)   \
        struct static_key_true name = 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 DECLARE_STATIC_KEY_FALSE(name) \
+       extern struct static_key_false name
+
+#define DEFINE_STATIC_KEY_ARRAY_TRUE(name, count)              \
+       struct static_key_true name[count] = {                  \
+               [0 ... (count) - 1] = STATIC_KEY_TRUE_INIT,     \
+       }
+
+#define DEFINE_STATIC_KEY_ARRAY_FALSE(name, count)             \
+       struct static_key_false name[count] = {                 \
+               [0 ... (count) - 1] = STATIC_KEY_FALSE_INIT,    \
+       }
+
 extern bool ____wrong_branch_error(void);
 
 #define static_key_enabled(x)                                                  \
@@ -384,6 +402,6 @@ extern bool ____wrong_branch_error(void);
 #define static_branch_enable(x)                static_key_enable(&(x)->key)
 #define static_branch_disable(x)       static_key_disable(&(x)->key)
 
-#endif /* _LINUX_JUMP_LABEL_H */
-
 #endif /* __ASSEMBLY__ */
+
+#endif /* _LINUX_JUMP_LABEL_H */