aboutsummaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/rethook.h
diff options
context:
space:
mode:
authorGravatar Haoran Jiang <jianghaoran@kylinos.cn> 2023-06-29 20:58:44 +0800
committerGravatar Huacai Chen <chenhuacai@loongson.cn> 2023-06-29 20:58:44 +0800
commit7b0a096436c2dac6de77d132e751a8a3328798d5 (patch)
tree2cfddd47c9438bc1ba0241836a22033f4473b627 /arch/loongarch/kernel/rethook.h
parentLoongArch: Add jump-label implementation (diff)
downloadlinux-7b0a096436c2dac6de77d132e751a8a3328798d5.tar.gz
linux-7b0a096436c2dac6de77d132e751a8a3328798d5.tar.bz2
linux-7b0a096436c2dac6de77d132e751a8a3328798d5.zip
LoongArch: Replace kretprobe with rethook
This is an adaptation of commit f3a112c0c40d ("x86,rethook,kprobes: Replace kretprobe with rethook on x86") and commit b57c2f124098 ("riscv: add riscv rethook implementation") to LoongArch. Mainly refer to commit b57c2f124098 ("riscv: add riscv rethook implementation"). Replaces the kretprobe code with rethook on LoongArch. With this patch, kretprobe on LoongArch uses the rethook instead of kretprobe specific trampoline code. Signed-off-by: Haoran Jiang <jianghaoran@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/rethook.h')
-rw-r--r--arch/loongarch/kernel/rethook.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/rethook.h b/arch/loongarch/kernel/rethook.h
new file mode 100644
index 000000000000..3f1c1edf0d0b
--- /dev/null
+++ b/arch/loongarch/kernel/rethook.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LOONGARCH_RETHOOK_H
+#define __LOONGARCH_RETHOOK_H
+
+unsigned long arch_rethook_trampoline_callback(struct pt_regs *regs);
+void arch_rethook_prepare(struct rethook_node *rhn, struct pt_regs *regs, bool mcount);
+
+#endif