aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-10-12 19:17:54 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-10-25 14:55:15 -0400
commit97ce2c88f9ad42e3c60a9beb9fca87abf3639faa (patch)
treec25d41a8754b6e11dbf54ba69ebbee11fdffd07e /include
parente71a5be15e47a73a2964712967fe93ee8ccf551b (diff)
jump-label: initialize jump-label subsystem much earlier
Initialize jump_labels much, much earlier, so they're available for use during system setup. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'include')
-rw-r--r--include/linux/jump_label.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 56594e45b011..388b0d425b50 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -16,7 +16,7 @@ struct jump_label_key {
16 16
17# include <asm/jump_label.h> 17# include <asm/jump_label.h>
18# define HAVE_JUMP_LABEL 18# define HAVE_JUMP_LABEL
19#endif 19#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
20 20
21enum jump_label_type { 21enum jump_label_type {
22 JUMP_LABEL_DISABLE = 0, 22 JUMP_LABEL_DISABLE = 0,
@@ -41,6 +41,7 @@ static __always_inline bool static_branch(struct jump_label_key *key)
41extern struct jump_entry __start___jump_table[]; 41extern struct jump_entry __start___jump_table[];
42extern struct jump_entry __stop___jump_table[]; 42extern struct jump_entry __stop___jump_table[];
43 43
44extern void jump_label_init(void);
44extern void jump_label_lock(void); 45extern void jump_label_lock(void);
45extern void jump_label_unlock(void); 46extern void jump_label_unlock(void);
46extern void arch_jump_label_transform(struct jump_entry *entry, 47extern void arch_jump_label_transform(struct jump_entry *entry,
@@ -53,7 +54,7 @@ extern void jump_label_dec(struct jump_label_key *key);
53extern bool jump_label_enabled(struct jump_label_key *key); 54extern bool jump_label_enabled(struct jump_label_key *key);
54extern void jump_label_apply_nops(struct module *mod); 55extern void jump_label_apply_nops(struct module *mod);
55 56
56#else 57#else /* !HAVE_JUMP_LABEL */
57 58
58#include <linux/atomic.h> 59#include <linux/atomic.h>
59 60
@@ -63,6 +64,10 @@ struct jump_label_key {
63 atomic_t enabled; 64 atomic_t enabled;
64}; 65};
65 66
67static __always_inline void jump_label_init(void)
68{
69}
70
66static __always_inline bool static_branch(struct jump_label_key *key) 71static __always_inline bool static_branch(struct jump_label_key *key)
67{ 72{
68 if (unlikely(atomic_read(&key->enabled))) 73 if (unlikely(atomic_read(&key->enabled)))
@@ -97,7 +102,6 @@ static inline int jump_label_apply_nops(struct module *mod)
97{ 102{
98 return 0; 103 return 0;
99} 104}
105#endif /* HAVE_JUMP_LABEL */
100 106
101#endif 107#endif /* _LINUX_JUMP_LABEL_H */
102
103#endif