0001
0002 #ifndef _ASM_UPROBES_H
0003 #define _ASM_UPROBES_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 typedef u32 uprobe_opcode_t;
0015
0016 #define MAX_UINSN_BYTES 4
0017 #define UPROBE_XOL_SLOT_BYTES (MAX_UINSN_BYTES * 2)
0018
0019 #define UPROBE_SWBP_INSN_SIZE 4
0020 #define UPROBE_SWBP_INSN 0x91d02073
0021 #define UPROBE_STP_INSN 0x91d02074
0022
0023 #define ANNUL_BIT (1 << 29)
0024
0025 struct arch_uprobe {
0026 union {
0027 u8 insn[MAX_UINSN_BYTES];
0028 u32 ixol;
0029 };
0030 };
0031
0032 struct arch_uprobe_task {
0033 u64 saved_tpc;
0034 u64 saved_tnpc;
0035 };
0036
0037 struct task_struct;
0038 struct notifier_block;
0039
0040 extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr);
0041 extern int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0042 extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0043 extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk);
0044 extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data);
0045 extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs);
0046
0047 #endif