Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274740
b: refs/heads/master
c: e71a5be
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Oct 25, 2011
1 parent 11f8a9a commit 24bdf2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: 61f42183fd15d5e666236f474d73b3555c7b83d1
refs/heads/master: e71a5be15e47a73a2964712967fe93ee8ccf551b
20 changes: 17 additions & 3 deletions trunk/arch/x86/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ union jump_code_union {
} __attribute__((packed));
};

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
static void __jump_label_transform(struct jump_entry *entry,
enum jump_label_type type,
void *(*poker)(void *, const void *, size_t))
{
union jump_code_union code;

Expand All @@ -35,11 +36,24 @@ void arch_jump_label_transform(struct jump_entry *entry,
(entry->code + JUMP_LABEL_NOP_SIZE);
} else
memcpy(&code, ideal_nops[NOP_ATOMIC5], JUMP_LABEL_NOP_SIZE);

(*poker)((void *)entry->code, &code, JUMP_LABEL_NOP_SIZE);
}

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
get_online_cpus();
mutex_lock(&text_mutex);
text_poke_smp((void *)entry->code, &code, JUMP_LABEL_NOP_SIZE);
__jump_label_transform(entry, type, text_poke_smp);
mutex_unlock(&text_mutex);
put_online_cpus();
}

void arch_jump_label_transform_static(struct jump_entry *entry,
enum jump_label_type type)
{
__jump_label_transform(entry, type, text_poke_early);
}

#endif

0 comments on commit 24bdf2f

Please sign in to comment.