diff options
author | Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | 2006-01-09 23:52:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:39 -0500 |
commit | 2d14e39da8712cff8a92298f464a25afb4283ccf (patch) | |
tree | 17de4fe24f4cba62b0fd2f611c3a031a98412d8d /kernel | |
parent | d1c0b8f835aeba85aa428aaec6d521ef4639c7fa (diff) |
[PATCH] kprobes: enable funcions only for required arch
Kernel/kprobes.c defines get_insn_slot() and free_insn_slot() which are
currently required _only_ for x86_64 and powerpc (which has no-exec support).
FYI, get{free}_insn_slot() functions manages the memory page which is mapped
as executable, required for instruction emulation.
This patch moves those two functions under __ARCH_WANT_KPROBES_INSN_SLOT and
defines __ARCH_WANT_KPROBES_INSN_SLOT in arch specific kprobes.h file.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kprobes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3bb71e63a37e..3897630d2335 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -52,6 +52,7 @@ static DEFINE_SPINLOCK(kprobe_lock); /* Protects kprobe_table */ | |||
52 | DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */ | 52 | DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */ |
53 | static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL; | 53 | static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL; |
54 | 54 | ||
55 | #ifdef __ARCH_WANT_KPROBES_INSN_SLOT | ||
55 | /* | 56 | /* |
56 | * kprobe->ainsn.insn points to the copy of the instruction to be | 57 | * kprobe->ainsn.insn points to the copy of the instruction to be |
57 | * single-stepped. x86_64, POWER4 and above have no-exec support and | 58 | * single-stepped. x86_64, POWER4 and above have no-exec support and |
@@ -151,6 +152,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t *slot) | |||
151 | } | 152 | } |
152 | } | 153 | } |
153 | } | 154 | } |
155 | #endif | ||
154 | 156 | ||
155 | /* We have preemption disabled.. so it is safe to use __ versions */ | 157 | /* We have preemption disabled.. so it is safe to use __ versions */ |
156 | static inline void set_kprobe_instance(struct kprobe *kp) | 158 | static inline void set_kprobe_instance(struct kprobe *kp) |