summaryrefslogtreecommitdiff
path: root/arch/csky/include/asm/uprobes.h
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-04-02 19:52:27 +0800
committerGuo Ren <guoren@linux.alibaba.com>2020-04-03 11:37:51 +0800
commit8f6bb793b2be82f1f73bfb416486f156f70b4314 (patch)
tree783eef0d08ebaa652b335db205f99e970d4a2c0d /arch/csky/include/asm/uprobes.h
parent33e53ae1ce413a081254e686d9b27cc1b3585e2f (diff)
downloadlinux-sh-8f6bb793b2be82f1f73bfb416486f156f70b4314.tar.gz
csky: Add uprobes support
This patch adds support for uprobes on csky architecture. Just like kprobe, it support single-step and simulate instructions. Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'arch/csky/include/asm/uprobes.h')
-rw-r--r--arch/csky/include/asm/uprobes.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/csky/include/asm/uprobes.h b/arch/csky/include/asm/uprobes.h
new file mode 100644
index 000000000000..600388eb93c6
--- /dev/null
+++ b/arch/csky/include/asm/uprobes.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_CSKY_UPROBES_H
+#define __ASM_CSKY_UPROBES_H
+
+#include <asm/probes.h>
+
+#define MAX_UINSN_BYTES 4
+
+#define UPROBE_SWBP_INSN USR_BKPT
+#define UPROBE_SWBP_INSN_SIZE 2
+#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
+
+typedef u32 uprobe_opcode_t;
+
+struct arch_uprobe_task {
+ unsigned long saved_trap_no;
+};
+
+struct arch_uprobe {
+ union {
+ u8 insn[MAX_UINSN_BYTES];
+ u8 ixol[MAX_UINSN_BYTES];
+ };
+ struct arch_probe_insn api;
+ unsigned long insn_size;
+ bool simulate;
+};
+
+int uprobe_breakpoint_handler(struct pt_regs *regs);
+int uprobe_single_step_handler(struct pt_regs *regs);
+
+#endif /* __ASM_CSKY_UPROBES_H */