aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-10 18:22:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:38 -0500
commitb3c1e01a09d6af2dd7811a066ffcfc5171be2bed (patch)
treee59bb3618ed20fe05caba4c8cb7e292b7b2559b1 /arch/h8300
parent7baab93f9297da3e42a8cecfbf91d5f22f415500 (diff)
ptrace: use ptrace_request() in the remaining architectures
Use ptrace_request() in the three remaining architectures that didn't use it (m68knommu, h8300, microblaze). This means: - ptrace_request now handles PTRACE_{PEEK,POKE}{TEXT,DATA} and PTRACE_DETATCH calls that were previously called directly, or in case of h8300 even open coded. - adds new support for PTRACE_SETOPTIONS/PTRACE_GETEVENTMSG/ PTRACE_GETSIGINFO/PTRACE_SETSIGINFO Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Michal Simek <monstr@monstr.eu> Acked-by: Greg Ungerer <gerg@uclinux.org> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300')
-rw-r--r--arch/h8300/kernel/ptrace.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index d32bbf02fc48..04bb9dd194ec 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -42,14 +42,6 @@ extern void h8300_enable_trace(struct task_struct *child);
42 * in exit.c or in signal.c. 42 * in exit.c or in signal.c.
43 */ 43 */
44 44
45inline
46static int read_long(struct task_struct * tsk, unsigned long addr,
47 unsigned long * result)
48{
49 *result = *(unsigned long *)addr;
50 return 0;
51}
52
53void ptrace_disable(struct task_struct *child) 45void ptrace_disable(struct task_struct *child)
54{ 46{
55 h8300_disable_trace(child); 47 h8300_disable_trace(child);
@@ -60,17 +52,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
60 int ret; 52 int ret;
61 53
62 switch (request) { 54 switch (request) {
63 case PTRACE_PEEKTEXT: /* read word at location addr. */
64 case PTRACE_PEEKDATA: {
65 unsigned long tmp;
66
67 ret = read_long(child, addr, &tmp);
68 if (ret < 0)
69 break ;
70 ret = put_user(tmp, (unsigned long *) data);
71 break ;
72 }
73
74 /* read the word at location addr in the USER area. */ 55 /* read the word at location addr in the USER area. */
75 case PTRACE_PEEKUSR: { 56 case PTRACE_PEEKUSR: {
76 unsigned long tmp = 0; 57 unsigned long tmp = 0;
@@ -109,11 +90,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
109 } 90 }
110 91
111 /* when I and D space are separate, this will have to be fixed. */ 92 /* when I and D space are separate, this will have to be fixed. */
112 case PTRACE_POKETEXT: /* write the word at location addr. */
113 case PTRACE_POKEDATA:
114 ret = generic_ptrace_pokedata(child, addr, data);
115 break;
116
117 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 93 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
118 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { 94 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {
119 ret = -EIO; 95 ret = -EIO;
@@ -175,10 +151,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
175 break; 151 break;
176 } 152 }
177 153
178 case PTRACE_DETACH: /* detach a process that was attached. */
179 ret = ptrace_detach(child, data);
180 break;
181
182 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 154 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
183 int i; 155 int i;
184 unsigned long tmp; 156 unsigned long tmp;
@@ -210,7 +182,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
210 } 182 }
211 183
212 default: 184 default:
213 ret = -EIO; 185 ret = ptrace_request(child, request, addr, data);
214 break; 186 break;
215 } 187 }
216 return ret; 188 return ret;