xref: /linux/arch/arm/probes/kprobes/checkers.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 /*
2  * arch/arm/probes/kprobes/checkers.h
3  *
4  * Copyright (C) 2014 Huawei Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  */
15 #ifndef _ARM_KERNEL_PROBES_CHECKERS_H
16 #define _ARM_KERNEL_PROBES_CHECKERS_H
17 
18 #include <linux/kernel.h>
19 #include <linux/types.h>
20 #include "../decode.h"
21 
22 extern probes_check_t checker_stack_use_none;
23 extern probes_check_t checker_stack_use_unknown;
24 #ifdef CONFIG_THUMB2_KERNEL
25 extern probes_check_t checker_stack_use_imm_0xx;
26 #else
27 extern probes_check_t checker_stack_use_imm_x0x;
28 #endif
29 extern probes_check_t checker_stack_use_imm_xxx;
30 extern probes_check_t checker_stack_use_stmdx;
31 
32 enum {
33 	STACK_USE_NONE,
34 	STACK_USE_UNKNOWN,
35 #ifdef CONFIG_THUMB2_KERNEL
36 	STACK_USE_FIXED_0XX,
37 	STACK_USE_T32STRD,
38 #else
39 	STACK_USE_FIXED_X0X,
40 #endif
41 	STACK_USE_FIXED_XXX,
42 	STACK_USE_STMDX,
43 	NUM_STACK_USE_TYPES
44 };
45 
46 extern const union decode_action stack_check_actions[];
47 
48 #ifndef CONFIG_THUMB2_KERNEL
49 extern const struct decode_checker arm_stack_checker[];
50 extern const struct decode_checker arm_regs_checker[];
51 #else
52 #endif
53 extern const struct decode_checker t32_stack_checker[];
54 extern const struct decode_checker t16_stack_checker[];
55 #endif
56