From a1df417e74aa6dae7352dc8cbb0ad471af5b7c69 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Mon, 25 Apr 2016 10:00:44 -0400 Subject: initial Olimex linux tree from Daniel, originally Feb 3, 2016 --- linux/arch/sparc/kernel/jump_label.c | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 linux/arch/sparc/kernel/jump_label.c (limited to 'linux/arch/sparc/kernel/jump_label.c') diff --git a/linux/arch/sparc/kernel/jump_label.c b/linux/arch/sparc/kernel/jump_label.c new file mode 100644 index 00000000..48565c11 --- /dev/null +++ b/linux/arch/sparc/kernel/jump_label.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +#include +#include + +#include + +#ifdef HAVE_JUMP_LABEL + +void arch_jump_label_transform(struct jump_entry *entry, + enum jump_label_type type) +{ + u32 val; + u32 *insn = (u32 *) (unsigned long) entry->code; + + if (type == JUMP_LABEL_ENABLE) { + s32 off = (s32)entry->target - (s32)entry->code; + +#ifdef CONFIG_SPARC64 + /* ba,pt %xcc, . + (off << 2) */ + val = 0x10680000 | ((u32) off >> 2); +#else + /* ba . + (off << 2) */ + val = 0x10800000 | ((u32) off >> 2); +#endif + } else { + val = 0x01000000; + } + + get_online_cpus(); + mutex_lock(&text_mutex); + *insn = val; + flushi(insn); + mutex_unlock(&text_mutex); + put_online_cpus(); +} + +#endif -- cgit