aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-08 03:34:14 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:19 -0400
commit4c4308cb93450989846ac49faeb6dab943e7657e (patch)
treec06092cae6f95a243cdd758d07491cf5fa24a1dd /arch/s390
parent6f716acd5fa20ae6a35ab29ae37fa9189e839ed5 (diff)
kprobes: kretprobes simplifications
- consolidate duplicate code in all arch_prepare_kretprobe instances into common code - replace various odd helpers that use hlist_for_each_entry to get the first elemenet of a list with either a hlist_for_each_entry_save or an opencoded access to the first element in the caller - inline add_rp_inst into it's only remaining caller - use kretprobe_inst_table_head instead of opencoding it Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/kprobes.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 8516a94d8163..9d0f0d09d473 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -271,23 +271,13 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
271} 271}
272 272
273/* Called with kretprobe_lock held */ 273/* Called with kretprobe_lock held */
274void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, 274void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
275 struct pt_regs *regs) 275 struct pt_regs *regs)
276{ 276{
277 struct kretprobe_instance *ri; 277 ri->ret_addr = (kprobe_opcode_t *) regs->gprs[14];
278 278
279 if ((ri = get_free_rp_inst(rp)) != NULL) { 279 /* Replace the return addr with trampoline addr */
280 ri->rp = rp; 280 regs->gprs[14] = (unsigned long)&kretprobe_trampoline;
281 ri->task = current;
282 ri->ret_addr = (kprobe_opcode_t *) regs->gprs[14];
283
284 /* Replace the return addr with trampoline addr */
285 regs->gprs[14] = (unsigned long)&kretprobe_trampoline;
286
287 add_rp_inst(ri);
288 } else {
289 rp->nmissed++;
290 }
291} 281}
292 282
293static int __kprobes kprobe_handler(struct pt_regs *regs) 283static int __kprobes kprobe_handler(struct pt_regs *regs)