Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / arm / kernel / jump_label.c
blob90bce3d9928e2f679c01d0bf13eabf2dead216f2
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include <linux/jump_label.h>
4 #include <asm/patch.h>
5 #include <asm/insn.h>
7 #ifdef HAVE_JUMP_LABEL
9 static void __arch_jump_label_transform(struct jump_entry *entry,
10 enum jump_label_type type,
11 bool is_static)
13 void *addr = (void *)entry->code;
14 unsigned int insn;
16 if (type == JUMP_LABEL_JMP)
17 insn = arm_gen_branch(entry->code, entry->target);
18 else
19 insn = arm_gen_nop();
21 if (is_static)
22 __patch_text_early(addr, insn);
23 else
24 patch_text(addr, insn);
27 void arch_jump_label_transform(struct jump_entry *entry,
28 enum jump_label_type type)
30 __arch_jump_label_transform(entry, type, false);
33 void arch_jump_label_transform_static(struct jump_entry *entry,
34 enum jump_label_type type)
36 __arch_jump_label_transform(entry, type, true);
39 #endif