ARM: use a function table for determining instruction interpreter action
[linux-2.6-block.git] / arch / arm / kernel / kprobes.h
CommitLineData
221bf15f
JM
1/*
2 * arch/arm/kernel/kprobes.h
3 *
0d1a095a
JM
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
221bf15f
JM
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/*
aceb487a 23 * These undefined instructions must be unique and
221bf15f
JM
24 * reserved solely for kprobes' use.
25 */
3b269455 26#define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0x07f001f8
aceb487a
JM
27#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
28#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018
29
3e6cd394
DL
30struct decode_header;
31union decode_action;
221bf15f
JM
32
33enum kprobe_insn {
34 INSN_REJECTED,
35 INSN_GOOD,
36 INSN_GOOD_NO_SLOT
37};
38
24371707 39typedef enum kprobe_insn (kprobe_decode_insn_t)(kprobe_opcode_t,
3e6cd394
DL
40 struct arch_specific_insn *,
41 const union decode_action *);
24371707
JM
42
43#ifdef CONFIG_THUMB2_KERNEL
44
45enum kprobe_insn thumb16_kprobe_decode_insn(kprobe_opcode_t,
3e6cd394
DL
46 struct arch_specific_insn *,
47 const union decode_action *);
24371707 48enum kprobe_insn thumb32_kprobe_decode_insn(kprobe_opcode_t,
3e6cd394
DL
49 struct arch_specific_insn *,
50 const union decode_action *);
24371707
JM
51
52#else /* !CONFIG_THUMB2_KERNEL */
53
221bf15f 54enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
3e6cd394
DL
55 struct arch_specific_insn *,
56 const union decode_action *);
57
24371707 58#endif
221bf15f
JM
59
60void __init arm_kprobe_decode_init(void);
61
c18377c3 62#include "probes.h"
0d1a095a 63
221bf15f 64#endif /* _ARM_KERNEL_KPROBES_H */