Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/kernel.h>
0003 #include <linux/jump_label.h>
0004 #include <asm/patch.h>
0005 #include <asm/insn.h>
0006 
0007 static void __arch_jump_label_transform(struct jump_entry *entry,
0008                     enum jump_label_type type,
0009                     bool is_static)
0010 {
0011     void *addr = (void *)entry->code;
0012     unsigned int insn;
0013 
0014     if (type == JUMP_LABEL_JMP)
0015         insn = arm_gen_branch(entry->code, entry->target);
0016     else
0017         insn = arm_gen_nop();
0018 
0019     if (is_static)
0020         __patch_text_early(addr, insn);
0021     else
0022         patch_text(addr, insn);
0023 }
0024 
0025 void arch_jump_label_transform(struct jump_entry *entry,
0026                    enum jump_label_type type)
0027 {
0028     __arch_jump_label_transform(entry, type, false);
0029 }