1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _ASM_RISCV_UPROBES_H
4 #define _ASM_RISCV_UPROBES_H
6 #include <asm/probes.h>
10 #define MAX_UINSN_BYTES 8
12 #ifdef CONFIG_RISCV_ISA_C
13 #define UPROBE_SWBP_INSN __BUG_INSN_16
14 #define UPROBE_SWBP_INSN_SIZE 2
16 #define UPROBE_SWBP_INSN __BUG_INSN_32
17 #define UPROBE_SWBP_INSN_SIZE 4
19 #define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
21 typedef u32 uprobe_opcode_t
;
23 struct arch_uprobe_task
{
24 unsigned long saved_cause
;
29 u8 insn
[MAX_UINSN_BYTES
];
30 u8 ixol
[MAX_UINSN_BYTES
];
32 struct arch_probe_insn api
;
33 unsigned long insn_size
;
38 bool uprobe_breakpoint_handler(struct pt_regs
*regs
);
39 bool uprobe_single_step_handler(struct pt_regs
*regs
);
41 static inline bool uprobe_breakpoint_handler(struct pt_regs
*regs
)
46 static inline bool uprobe_single_step_handler(struct pt_regs
*regs
)
50 #endif /* CONFIG_UPROBES */
51 #endif /* _ASM_RISCV_UPROBES_H */