xref: /openbmc/linux/arch/mips/include/asm/uprobes.h (revision 0cce284537fb42d9c28b9b31038ffc9b464555f5)
1*40e084a5SRalf Baechle /*
2*40e084a5SRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
3*40e084a5SRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
4*40e084a5SRalf Baechle  * for more details.
5*40e084a5SRalf Baechle  */
6*40e084a5SRalf Baechle #ifndef __ASM_UPROBES_H
7*40e084a5SRalf Baechle #define __ASM_UPROBES_H
8*40e084a5SRalf Baechle 
9*40e084a5SRalf Baechle #include <linux/notifier.h>
10*40e084a5SRalf Baechle #include <linux/types.h>
11*40e084a5SRalf Baechle 
12*40e084a5SRalf Baechle #include <asm/break.h>
13*40e084a5SRalf Baechle #include <asm/inst.h>
14*40e084a5SRalf Baechle 
15*40e084a5SRalf Baechle /*
16*40e084a5SRalf Baechle  * We want this to be defined as union mips_instruction but that makes the
17*40e084a5SRalf Baechle  * generic code blow up.
18*40e084a5SRalf Baechle  */
19*40e084a5SRalf Baechle typedef u32 uprobe_opcode_t;
20*40e084a5SRalf Baechle 
21*40e084a5SRalf Baechle /*
22*40e084a5SRalf Baechle  * Classic MIPS (note this implementation doesn't consider microMIPS yet)
23*40e084a5SRalf Baechle  * instructions are always 4 bytes but in order to deal with branches and
24*40e084a5SRalf Baechle  * their delay slots, we treat instructions as having 8 bytes maximum.
25*40e084a5SRalf Baechle  */
26*40e084a5SRalf Baechle #define MAX_UINSN_BYTES			8
27*40e084a5SRalf Baechle #define UPROBE_XOL_SLOT_BYTES		128	/* Max. cache line size */
28*40e084a5SRalf Baechle 
29*40e084a5SRalf Baechle #define UPROBE_BRK_UPROBE		0x000d000d	/* break 13 */
30*40e084a5SRalf Baechle #define UPROBE_BRK_UPROBE_XOL		0x000e000d	/* break 14 */
31*40e084a5SRalf Baechle 
32*40e084a5SRalf Baechle #define UPROBE_SWBP_INSN		UPROBE_BRK_UPROBE
33*40e084a5SRalf Baechle #define UPROBE_SWBP_INSN_SIZE		4
34*40e084a5SRalf Baechle 
35*40e084a5SRalf Baechle struct arch_uprobe {
36*40e084a5SRalf Baechle 	unsigned long	resume_epc;
37*40e084a5SRalf Baechle 	u32	insn[2];
38*40e084a5SRalf Baechle 	u32	ixol[2];
39*40e084a5SRalf Baechle };
40*40e084a5SRalf Baechle 
41*40e084a5SRalf Baechle struct arch_uprobe_task {
42*40e084a5SRalf Baechle 	unsigned long saved_trap_nr;
43*40e084a5SRalf Baechle };
44*40e084a5SRalf Baechle 
45*40e084a5SRalf Baechle #endif /* __ASM_UPROBES_H */
46