1 // SPDX-License-Identifier: GPL-2.0 1 2 /* 3 * Generic return hook for LoongArch. 4 */ 5 6 #include <linux/kprobes.h> 7 #include <linux/rethook.h> 8 #include "rethook.h" 9 10 /* This is called from arch_rethook_trampoline 11 unsigned long __used arch_rethook_trampoline_c 12 { 13 return rethook_trampoline_handler(regs 14 } 15 NOKPROBE_SYMBOL(arch_rethook_trampoline_callba 16 17 void arch_rethook_prepare(struct rethook_node 18 { 19 rhn->frame = 0; 20 rhn->ret_addr = regs->regs[1]; 21 22 /* replace return addr with trampoline 23 regs->regs[1] = (unsigned long)arch_re 24 } 25 NOKPROBE_SYMBOL(arch_rethook_prepare); 26 27 /* ASM function that handles the rethook must 28 NOKPROBE_SYMBOL(arch_rethook_trampoline); 29
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.