projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PTRACE_POKEDATA consolidation
[powerpc.git]
/
arch
/
sh
/
kernel
/
ptrace.c
diff --git
a/arch/sh/kernel/ptrace.c
b/arch/sh/kernel/ptrace.c
index
855f724
..
891d1d4
100644
(file)
--- a/
arch/sh/kernel/ptrace.c
+++ b/
arch/sh/kernel/ptrace.c
@@
-12,7
+12,6
@@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
@@
-92,17
+91,8
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
- case PTRACE_PEEKDATA: {
- unsigned long tmp;
- int copied;
-
- copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
- ret = -EIO;
- if (copied != sizeof(tmp))
- break;
- ret = put_user(tmp,(unsigned long *) data);
- break;
- }
+ case PTRACE_PEEKDATA:
+ ret = generic_ptrace_peekdata(child, addr, data);
/* read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
/* read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
@@
-129,17
+119,14
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
tmp = !!tsk_used_math(child);
else
tmp = 0;
tmp = !!tsk_used_math(child);
else
tmp = 0;
- ret = put_user(tmp, (unsigned long *)data);
+ ret = put_user(tmp, (unsigned long
__user
*)data);
break;
}
/* when I and D space are separate, this will have to be fixed. */
case PTRACE_POKETEXT: /* write the word at location addr. */
case PTRACE_POKEDATA:
break;
}
/* when I and D space are separate, this will have to be fixed. */
case PTRACE_POKETEXT: /* write the word at location addr. */
case PTRACE_POKEDATA:
- ret = 0;
- if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
- break;
- ret = -EIO;
+ ret = generic_ptrace_pokedata(child, addr, data);
break;
case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
break;
case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
@@
-197,7
+184,7
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
case PTRACE_SINGLESTEP: { /* set the trap flag. */
long pc;
case PTRACE_SINGLESTEP: { /* set the trap flag. */
long pc;
- struct pt_regs *
dummy
= NULL;
+ struct pt_regs *
regs
= NULL;
ret = -EIO;
if (!valid_signal(data))
ret = -EIO;
if (!valid_signal(data))
@@
-208,7
+195,7
@@
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
child->ptrace |= PT_DTRACE;
}
child->ptrace |= PT_DTRACE;
}
- pc = get_stack_long(child, (long)&
dummy
->pc);
+ pc = get_stack_long(child, (long)&
regs
->pc);
/* Next scheduling will set up UBC */
if (child->thread.ubc_pc == 0)
/* Next scheduling will set up UBC */
if (child->thread.ubc_pc == 0)