drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / riscv / include / asm / uprobes.h
blob3fc7deda9190251510f96d952c5276a900912676
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>
7 #include <asm/patch.h>
8 #include <asm/bug.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
15 #else
16 #define UPROBE_SWBP_INSN __BUG_INSN_32
17 #define UPROBE_SWBP_INSN_SIZE 4
18 #endif
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;
27 struct arch_uprobe {
28 union {
29 u8 insn[MAX_UINSN_BYTES];
30 u8 ixol[MAX_UINSN_BYTES];
32 struct arch_probe_insn api;
33 unsigned long insn_size;
34 bool simulate;
37 #ifdef CONFIG_UPROBES
38 bool uprobe_breakpoint_handler(struct pt_regs *regs);
39 bool uprobe_single_step_handler(struct pt_regs *regs);
40 #else
41 static inline bool uprobe_breakpoint_handler(struct pt_regs *regs)
43 return false;
46 static inline bool uprobe_single_step_handler(struct pt_regs *regs)
48 return false;
50 #endif /* CONFIG_UPROBES */
51 #endif /* _ASM_RISCV_UPROBES_H */