aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/kprobes.h17
-rw-r--r--arch/arm/kernel/kprobes-arm.c2
-rw-r--r--arch/arm/kernel/kprobes.c2
-rw-r--r--arch/arm/kernel/kprobes.h37
4 files changed, 41 insertions, 17 deletions
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index e46bdd0097eb..57d37d52d71e 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -24,12 +24,6 @@
24#define MAX_INSN_SIZE 2 24#define MAX_INSN_SIZE 2
25#define MAX_STACK_SIZE 64 /* 32 would probably be OK */ 25#define MAX_STACK_SIZE 64 /* 32 would probably be OK */
26 26
27/*
28 * This undefined instruction must be unique and
29 * reserved solely for kprobes' use.
30 */
31#define KPROBE_BREAKPOINT_INSTRUCTION 0xe7f001f8
32
33#define regs_return_value(regs) ((regs)->ARM_r0) 27#define regs_return_value(regs) ((regs)->ARM_r0)
34#define flush_insn_slot(p) do { } while (0) 28#define flush_insn_slot(p) do { } while (0)
35#define kretprobe_blacklist_size 0 29#define kretprobe_blacklist_size 0
@@ -62,20 +56,9 @@ struct kprobe_ctlblk {
62}; 56};
63 57
64void arch_remove_kprobe(struct kprobe *); 58void arch_remove_kprobe(struct kprobe *);
65void kretprobe_trampoline(void);
66
67int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); 59int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
68int kprobe_exceptions_notify(struct notifier_block *self, 60int kprobe_exceptions_notify(struct notifier_block *self,
69 unsigned long val, void *data); 61 unsigned long val, void *data);
70 62
71enum kprobe_insn {
72 INSN_REJECTED,
73 INSN_GOOD,
74 INSN_GOOD_NO_SLOT
75};
76
77enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
78 struct arch_specific_insn *);
79void __init arm_kprobe_decode_init(void);
80 63
81#endif /* _ARM_KPROBES_H */ 64#endif /* _ARM_KPROBES_H */
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 15eeff6aea0e..976ce14c5576 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -61,6 +61,8 @@
61#include <linux/kernel.h> 61#include <linux/kernel.h>
62#include <linux/kprobes.h> 62#include <linux/kprobes.h>
63 63
64#include "kprobes.h"
65
64#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit))))) 66#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
65 67
66#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25) 68#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 1656c87501c0..3ba5f8d0d82c 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -28,6 +28,8 @@
28#include <asm/traps.h> 28#include <asm/traps.h>
29#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
30 30
31#include "kprobes.h"
32
31#define MIN_STACK_SIZE(addr) \ 33#define MIN_STACK_SIZE(addr) \
32 min((unsigned long)MAX_STACK_SIZE, \ 34 min((unsigned long)MAX_STACK_SIZE, \
33 (unsigned long)current_thread_info() + THREAD_START_SP - (addr)) 35 (unsigned long)current_thread_info() + THREAD_START_SP - (addr))
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h
new file mode 100644
index 000000000000..87a5241b2f18
--- /dev/null
+++ b/arch/arm/kernel/kprobes.h
@@ -0,0 +1,37 @@
1/*
2 * arch/arm/kernel/kprobes.h
3 *
4 * Contents moved from arch/arm/include/asm/kprobes.h which is
5 * Copyright (C) 2006, 2007 Motorola Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16
17#ifndef _ARM_KERNEL_KPROBES_H
18#define _ARM_KERNEL_KPROBES_H
19
20/*
21 * This undefined instruction must be unique and
22 * reserved solely for kprobes' use.
23 */
24#define KPROBE_BREAKPOINT_INSTRUCTION 0xe7f001f8
25
26enum kprobe_insn {
27 INSN_REJECTED,
28 INSN_GOOD,
29 INSN_GOOD_NO_SLOT
30};
31
32enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
33 struct arch_specific_insn *);
34
35void __init arm_kprobe_decode_init(void);
36
37#endif /* _ARM_KERNEL_KPROBES_H */