aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ptrace.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2009-09-22 16:58:48 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-22 16:58:45 -0400
commit07805ac81c81634623042408ffea6bbad3160bfa (patch)
tree215f40336ba0b9c9663337c9d99409c4a35d71d9 /arch/s390/kernel/ptrace.c
parentbdd42b28cde0453fb8c3d9b4e4868ca2d8124806 (diff)
[S390] ptrace: use common code for simple peek/poke operations
arch_ptrace on s390 implements PTRACE_(PEEK|POKE)(TEXT|DATA) instead of using using ptrace_request in kernel/ptrace.c. The only reason is the 31bit addressing mode, where we have to unmask the highest bit. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ptrace.c')
-rw-r--r--arch/s390/kernel/ptrace.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index f3ddd7ac06c5..a8738676b26c 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -339,24 +339,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
339 int copied, ret; 339 int copied, ret;
340 340
341 switch (request) { 341 switch (request) {
342 case PTRACE_PEEKTEXT:
343 case PTRACE_PEEKDATA:
344 /* Remove high order bit from address (only for 31 bit). */
345 addr &= PSW_ADDR_INSN;
346 /* read word at location addr. */
347 return generic_ptrace_peekdata(child, addr, data);
348
349 case PTRACE_PEEKUSR: 342 case PTRACE_PEEKUSR:
350 /* read the word at location addr in the USER area. */ 343 /* read the word at location addr in the USER area. */
351 return peek_user(child, addr, data); 344 return peek_user(child, addr, data);
352 345
353 case PTRACE_POKETEXT:
354 case PTRACE_POKEDATA:
355 /* Remove high order bit from address (only for 31 bit). */
356 addr &= PSW_ADDR_INSN;
357 /* write the word at location addr. */
358 return generic_ptrace_pokedata(child, addr, data);
359
360 case PTRACE_POKEUSR: 346 case PTRACE_POKEUSR:
361 /* write the word at location addr in the USER area */ 347 /* write the word at location addr in the USER area */
362 return poke_user(child, addr, data); 348 return poke_user(child, addr, data);
@@ -386,8 +372,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
386 copied += sizeof(unsigned long); 372 copied += sizeof(unsigned long);
387 } 373 }
388 return 0; 374 return 0;
375 default:
376 /* Removing high order bit from addr (only for 31 bit). */
377 addr &= PSW_ADDR_INSN;
378 return ptrace_request(child, request, addr, data);
389 } 379 }
390 return ptrace_request(child, request, addr, data);
391} 380}
392 381
393#ifdef CONFIG_COMPAT 382#ifdef CONFIG_COMPAT