]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/arm/kernel/jump_label.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / arm / kernel / jump_label.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
09f05d85
RV
2#include <linux/kernel.h>
3#include <linux/jump_label.h>
fca08f32 4#include <asm/patch.h>
0dc016db 5#include <asm/insn.h>
09f05d85
RV
6
7#ifdef HAVE_JUMP_LABEL
8
9static void __arch_jump_label_transform(struct jump_entry *entry,
10 enum jump_label_type type,
11 bool is_static)
12{
13 void *addr = (void *)entry->code;
14 unsigned int insn;
15
76b235c6 16 if (type == JUMP_LABEL_JMP)
09f05d85
RV
17 insn = arm_gen_branch(entry->code, entry->target);
18 else
19 insn = arm_gen_nop();
20
21 if (is_static)
ab0615e2 22 __patch_text_early(addr, insn);
09f05d85
RV
23 else
24 patch_text(addr, insn);
25}
26
27void arch_jump_label_transform(struct jump_entry *entry,
28 enum jump_label_type type)
29{
30 __arch_jump_label_transform(entry, type, false);
31}
32
33void arch_jump_label_transform_static(struct jump_entry *entry,
34 enum jump_label_type type)
35{
36 __arch_jump_label_transform(entry, type, true);
37}
38
39#endif