xref: /linux/arch/arm/include/asm/uprobes.h (revision fcc8487d477a3452a1d0ccbdd4c5e0e1e3cb8bed)
1 /*
2  * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8 
9 #ifndef _ASM_UPROBES_H
10 #define _ASM_UPROBES_H
11 
12 #include <asm/probes.h>
13 #include <asm/opcodes.h>
14 
15 typedef u32 uprobe_opcode_t;
16 
17 #define MAX_UINSN_BYTES		4
18 #define UPROBE_XOL_SLOT_BYTES	64
19 
20 #define UPROBE_SWBP_ARM_INSN	0xe7f001f9
21 #define UPROBE_SS_ARM_INSN	0xe7f001fa
22 #define UPROBE_SWBP_INSN	__opcode_to_mem_arm(UPROBE_SWBP_ARM_INSN)
23 #define UPROBE_SWBP_INSN_SIZE	4
24 
25 struct arch_uprobe_task {
26 	u32 backup;
27 	unsigned long	saved_trap_no;
28 };
29 
30 struct arch_uprobe {
31 	u8 insn[MAX_UINSN_BYTES];
32 	unsigned long ixol[2];
33 	uprobe_opcode_t bpinsn;
34 	bool simulate;
35 	u32 pcreg;
36 	void (*prehandler)(struct arch_uprobe *auprobe,
37 			   struct arch_uprobe_task *autask,
38 			   struct pt_regs *regs);
39 	void (*posthandler)(struct arch_uprobe *auprobe,
40 			    struct arch_uprobe_task *autask,
41 			    struct pt_regs *regs);
42 	struct arch_probes_insn asi;
43 };
44 
45 #endif
46