diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-09-14 19:21:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-14 21:09:37 -0400 |
commit | f2833aef6a0517e933992c8007f330d0df5d9317 (patch) | |
tree | b1f664d138b897a5d3f28bfc5e242089a4435916 /arch/um/sys-x86_64/ptrace.c | |
parent | 01599cdc2f891415387aed9921909b3e9f27c801 (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-x86_64/ptrace.c')
-rw-r--r-- | arch/um/sys-x86_64/ptrace.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index 7ed49ac78f88..4005506834fd 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -145,7 +145,7 @@ int is_syscall(unsigned long addr) | |||
145 | return instr == 0x050f; | 145 | return instr == 0x050f; |
146 | } | 146 | } |
147 | 147 | ||
148 | int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 148 | static 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 | long fpregs[HOST_FP_SIZE]; | 151 | long fpregs[HOST_FP_SIZE]; |
@@ -162,7 +162,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
162 | return n; | 162 | return n; |
163 | } | 163 | } |
164 | 164 | ||
165 | int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 165 | static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
166 | { | 166 | { |
167 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 167 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
168 | long fpregs[HOST_FP_SIZE]; | 168 | long fpregs[HOST_FP_SIZE]; |
@@ -178,5 +178,21 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
178 | long subarch_ptrace(struct task_struct *child, long request, | 178 | long subarch_ptrace(struct task_struct *child, long request, |
179 | unsigned long addr, unsigned long data) | 179 | unsigned long addr, unsigned long data) |
180 | { | 180 | { |
181 | return -EIO; | 181 | int ret = -EIO; |
182 | void __user *datap = (void __user *) data; | ||
183 | |||
184 | switch (request) { | ||
185 | case PTRACE_GETFPREGS: /* Get the child FPU state. */ | ||
186 | ret = get_fpregs(datap, child); | ||
187 | break; | ||
188 | case PTRACE_SETFPREGS: /* Set the child FPU state. */ | ||
189 | ret = set_fpregs(datap, child); | ||
190 | break; | ||
191 | case PTRACE_ARCH_PRCTL: | ||
192 | /* XXX Calls ptrace on the host - needs some SMP thinking */ | ||
193 | ret = arch_prctl(child, data, (void __user *) addr); | ||
194 | break; | ||
195 | } | ||
196 | |||
197 | return ret; | ||
182 | } | 198 | } |