aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386/ptrace.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2011-09-14 19:21:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-14 21:09:37 -0400
commitf2833aef6a0517e933992c8007f330d0df5d9317 (patch)
treeb1f664d138b897a5d3f28bfc5e242089a4435916 /arch/um/sys-i386/ptrace.c
parent01599cdc2f891415387aed9921909b3e9f27c801 (diff)
um: clean arch_ptrace() up a bit
1) take subarch-specific stuff to subarch_ptrace() 2) PTRACE_{PEEK,POKE}{TEXT,DATA} is handled by ptrace_request() just fine... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/sys-i386/ptrace.c')
-rw-r--r--arch/um/sys-i386/ptrace.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index 49fd25a5f206..3375c2717851 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -145,7 +145,7 @@ int peek_user(struct task_struct *child, long addr, long data)
145 return put_user(tmp, (unsigned long __user *) data); 145 return put_user(tmp, (unsigned long __user *) data);
146} 146}
147 147
148int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) 148static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
149{ 149{
150 int err, n, cpu = ((struct thread_info *) child->stack)->cpu; 150 int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
151 struct user_i387_struct fpregs; 151 struct user_i387_struct fpregs;
@@ -161,7 +161,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
161 return n; 161 return n;
162} 162}
163 163
164int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) 164static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
165{ 165{
166 int n, cpu = ((struct thread_info *) child->stack)->cpu; 166 int n, cpu = ((struct thread_info *) child->stack)->cpu;
167 struct user_i387_struct fpregs; 167 struct user_i387_struct fpregs;
@@ -174,7 +174,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
174 (unsigned long *) &fpregs); 174 (unsigned long *) &fpregs);
175} 175}
176 176
177int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) 177static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
178{ 178{
179 int err, n, cpu = ((struct thread_info *) child->stack)->cpu; 179 int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
180 struct user_fxsr_struct fpregs; 180 struct user_fxsr_struct fpregs;
@@ -190,7 +190,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
190 return n; 190 return n;
191} 191}
192 192
193int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) 193static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
194{ 194{
195 int n, cpu = ((struct thread_info *) child->stack)->cpu; 195 int n, cpu = ((struct thread_info *) child->stack)->cpu;
196 struct user_fxsr_struct fpregs; 196 struct user_fxsr_struct fpregs;
@@ -208,15 +208,21 @@ long subarch_ptrace(struct task_struct *child, long request,
208{ 208{
209 int ret = -EIO; 209 int ret = -EIO;
210 void __user *datap = (void __user *) data; 210 void __user *datap = (void __user *) data;
211
212 switch (request) { 211 switch (request) {
212 case PTRACE_GETFPREGS: /* Get the child FPU state. */
213 ret = get_fpregs(datap, child);
214 break;
215 case PTRACE_SETFPREGS: /* Set the child FPU state. */
216 ret = set_fpregs(datap, child);
217 break;
213 case PTRACE_GETFPXREGS: /* Get the child FPU state. */ 218 case PTRACE_GETFPXREGS: /* Get the child FPU state. */
214 ret = get_fpxregs(datap, child); 219 ret = get_fpxregs(datap, child);
215 break; 220 break;
216 case PTRACE_SETFPXREGS: /* Set the child FPU state. */ 221 case PTRACE_SETFPXREGS: /* Set the child FPU state. */
217 ret = set_fpxregs(datap, child); 222 ret = set_fpxregs(datap, child);
218 break; 223 break;
224 default:
225 ret = -EIO;
219 } 226 }
220
221 return ret; 227 return ret;
222} 228}