1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copied from arch/arm64/include/asm/kprobes.h
5 * Copyright (C) 2013 Linaro Limited
6 * Copyright (C) 2017 SiFive
9 #ifndef _ASM_RISCV_KPROBES_H
10 #define _ASM_RISCV_KPROBES_H
12 #include <asm-generic/kprobes.h>
15 #include <linux/types.h>
16 #include <linux/ptrace.h>
17 #include <linux/percpu.h>
19 #define __ARCH_WANT_KPROBES_INSN_SLOT
20 #define MAX_INSN_SIZE 2
22 #define flush_insn_slot(p) do { } while (0)
23 #define kretprobe_blacklist_size 0
25 #include <asm/probes.h>
32 /* per-cpu kprobe control block */
33 struct kprobe_ctlblk
{
34 unsigned int kprobe_status
;
35 unsigned long saved_status
;
36 struct prev_kprobe prev_kprobe
;
39 void arch_remove_kprobe(struct kprobe
*p
);
40 int kprobe_fault_handler(struct pt_regs
*regs
, unsigned int trapnr
);
41 bool kprobe_breakpoint_handler(struct pt_regs
*regs
);
42 bool kprobe_single_step_handler(struct pt_regs
*regs
);
44 static inline bool kprobe_breakpoint_handler(struct pt_regs
*regs
)
49 static inline bool kprobe_single_step_handler(struct pt_regs
*regs
)
53 #endif /* CONFIG_KPROBES */
54 #endif /* _ASM_RISCV_KPROBES_H */