Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274741
b: refs/heads/master
c: 97ce2c8
h: refs/heads/master
i:
  274739: 11f8a9a
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Oct 25, 2011
1 parent 24bdf2f commit 91106c2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e71a5be15e47a73a2964712967fe93ee8ccf551b
refs/heads/master: 97ce2c88f9ad42e3c60a9beb9fca87abf3639faa
14 changes: 9 additions & 5 deletions trunk/include/linux/jump_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct jump_label_key {

# include <asm/jump_label.h>
# define HAVE_JUMP_LABEL
#endif
#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */

enum jump_label_type {
JUMP_LABEL_DISABLE = 0,
Expand All @@ -41,6 +41,7 @@ static __always_inline bool static_branch(struct jump_label_key *key)
extern struct jump_entry __start___jump_table[];
extern struct jump_entry __stop___jump_table[];

extern void jump_label_init(void);
extern void jump_label_lock(void);
extern void jump_label_unlock(void);
extern void arch_jump_label_transform(struct jump_entry *entry,
Expand All @@ -53,7 +54,7 @@ extern void jump_label_dec(struct jump_label_key *key);
extern bool jump_label_enabled(struct jump_label_key *key);
extern void jump_label_apply_nops(struct module *mod);

#else
#else /* !HAVE_JUMP_LABEL */

#include <linux/atomic.h>

Expand All @@ -63,6 +64,10 @@ struct jump_label_key {
atomic_t enabled;
};

static __always_inline void jump_label_init(void)
{
}

static __always_inline bool static_branch(struct jump_label_key *key)
{
if (unlikely(atomic_read(&key->enabled)))
Expand Down Expand Up @@ -97,7 +102,6 @@ static inline int jump_label_apply_nops(struct module *mod)
{
return 0;
}
#endif /* HAVE_JUMP_LABEL */

#endif

#endif
#endif /* _LINUX_JUMP_LABEL_H */
3 changes: 3 additions & 0 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ asmlinkage void __init start_kernel(void)
parse_args("Booting kernel", static_command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);

jump_label_init();

/*
* These use large bootmem allocations and must precede
* kmem_cache_init()
Expand Down
5 changes: 1 addition & 4 deletions trunk/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void __jump_label_update(struct jump_label_key *key,
}
}

static __init int jump_label_init(void)
void __init jump_label_init(void)
{
struct jump_entry *iter_start = __start___jump_table;
struct jump_entry *iter_stop = __stop___jump_table;
Expand All @@ -159,10 +159,7 @@ static __init int jump_label_init(void)
#endif
}
jump_label_unlock();

return 0;
}
early_initcall(jump_label_init);

#ifdef CONFIG_MODULES

Expand Down

0 comments on commit 91106c2

Please sign in to comment.