xref: /openbmc/linux/arch/arm/probes/kprobes/core.h (revision 83803d97)
1 /*
2  * arch/arm/kernel/kprobes.h
3  *
4  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
5  *
6  * Some contents moved here from arch/arm/include/asm/kprobes.h which is
7  * Copyright (C) 2006, 2007 Motorola Inc.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  */
18 
19 #ifndef _ARM_KERNEL_KPROBES_H
20 #define _ARM_KERNEL_KPROBES_H
21 
22 #include <asm/kprobes.h>
23 #include "../decode.h"
24 
25 /*
26  * These undefined instructions must be unique and
27  * reserved solely for kprobes' use.
28  */
29 #define KPROBE_ARM_BREAKPOINT_INSTRUCTION	0x07f001f8
30 #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION	0xde18
31 #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION	0xf7f0a018
32 
33 enum probes_insn __kprobes
34 kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_probes_insn *asi,
35 		const struct decode_header *h);
36 
37 typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
38 						struct arch_probes_insn *,
39 						bool,
40 						const union decode_action *,
41 						const struct decode_checker *[*]);
42 
43 #ifdef CONFIG_THUMB2_KERNEL
44 
45 extern const union decode_action kprobes_t32_actions[];
46 extern const union decode_action kprobes_t16_actions[];
47 extern const struct decode_checker *kprobes_t32_checkers[];
48 extern const struct decode_checker *kprobes_t16_checkers[];
49 #else /* !CONFIG_THUMB2_KERNEL */
50 
51 extern const union decode_action kprobes_arm_actions[];
52 extern const struct decode_checker *kprobes_arm_checkers[];
53 
54 #endif
55 
56 #endif /* _ARM_KERNEL_KPROBES_H */
57