1 // SPDX-License-Identifier: GPL-2.0 1 2 #include <linux/memory.h> 3 #include <linux/static_call.h> 4 5 #include <asm/code-patching.h> 6 7 void arch_static_call_transform(void *site, vo 8 { 9 int err; 10 bool is_ret0 = (func == __static_call_ 11 unsigned long target = (unsigned long) 12 bool is_short = is_offset_in_branch_ra 13 14 if (!tramp) 15 return; 16 17 mutex_lock(&text_mutex); 18 19 if (func && !is_short) { 20 err = patch_instruction(tramp 21 if (err) 22 goto out; 23 } 24 25 if (!func) 26 err = patch_instruction(tramp, 27 else if (is_short) 28 err = patch_branch(tramp, targ 29 else 30 err = patch_instruction(tramp, 31 out: 32 mutex_unlock(&text_mutex); 33 34 if (err) 35 panic("%s: patching failed %pS 36 } 37 EXPORT_SYMBOL_GPL(arch_static_call_transform); 38
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.