xref: /linux/arch/arm/probes/kprobes/core.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * arch/arm/kernel/kprobes.h
4  *
5  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
6  *
7  * Some contents moved here from arch/arm/include/asm/kprobes.h which is
8  * Copyright (C) 2006, 2007 Motorola Inc.
9  */
10 
11 #ifndef _ARM_KERNEL_KPROBES_H
12 #define _ARM_KERNEL_KPROBES_H
13 
14 #include <asm/kprobes.h>
15 #include "../decode.h"
16 
17 /*
18  * These undefined instructions must be unique and
19  * reserved solely for kprobes' use.
20  */
21 #define KPROBE_ARM_BREAKPOINT_INSTRUCTION	0x07f001f8
22 #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION	0xde18
23 #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION	0xf7f0a018
24 
25 extern void kprobes_remove_breakpoint(void *addr, unsigned int insn);
26 
27 enum probes_insn __kprobes
28 kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_probes_insn *asi,
29 		const struct decode_header *h);
30 
31 typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
32 						struct arch_probes_insn *,
33 						bool,
34 						const union decode_action *,
35 						const struct decode_checker *[]);
36 
37 #ifdef CONFIG_THUMB2_KERNEL
38 
39 extern const union decode_action kprobes_t32_actions[];
40 extern const union decode_action kprobes_t16_actions[];
41 extern const struct decode_checker *kprobes_t32_checkers[];
42 extern const struct decode_checker *kprobes_t16_checkers[];
43 #else /* !CONFIG_THUMB2_KERNEL */
44 
45 extern const union decode_action kprobes_arm_actions[];
46 extern const struct decode_checker *kprobes_arm_checkers[];
47 
48 #endif
49 
50 #endif /* _ARM_KERNEL_KPROBES_H */
51