diff options
Diffstat (limited to 'arch/um/sys-i386/ptrace.c')
-rw-r--r-- | arch/um/sys-i386/ptrace.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index 6b4499906a6..c9b176534d6 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c | |||
@@ -148,14 +148,13 @@ int peek_user(struct task_struct *child, long addr, long data) | |||
148 | int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 148 | 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 | struct user_i387_struct fpregs; |
152 | 152 | ||
153 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 153 | err = save_fp_registers(userspace_pid[cpu], (unsigned long *) &fpregs); |
154 | err = save_fp_registers(userspace_pid[cpu], fpregs); | ||
155 | if (err) | 154 | if (err) |
156 | return err; | 155 | return err; |
157 | 156 | ||
158 | n = copy_to_user(buf, fpregs, sizeof(fpregs)); | 157 | n = copy_to_user(buf, &fpregs, sizeof(fpregs)); |
159 | if(n > 0) | 158 | if(n > 0) |
160 | return -EFAULT; | 159 | return -EFAULT; |
161 | 160 | ||
@@ -165,27 +164,26 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
165 | int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 164 | int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
166 | { | 165 | { |
167 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 166 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
168 | long fpregs[HOST_FP_SIZE]; | 167 | struct user_i387_struct fpregs; |
169 | 168 | ||
170 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 169 | n = copy_from_user(&fpregs, buf, sizeof(fpregs)); |
171 | n = copy_from_user(fpregs, buf, sizeof(fpregs)); | ||
172 | if (n > 0) | 170 | if (n > 0) |
173 | return -EFAULT; | 171 | return -EFAULT; |
174 | 172 | ||
175 | return restore_fp_registers(userspace_pid[cpu], fpregs); | 173 | return restore_fp_registers(userspace_pid[cpu], |
174 | (unsigned long *) &fpregs); | ||
176 | } | 175 | } |
177 | 176 | ||
178 | int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | 177 | int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) |
179 | { | 178 | { |
180 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; | 179 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; |
181 | long fpregs[HOST_XFP_SIZE]; | 180 | struct user_fxsr_struct fpregs; |
182 | 181 | ||
183 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 182 | err = save_fpx_registers(userspace_pid[cpu], (unsigned long *) &fpregs); |
184 | err = save_fpx_registers(userspace_pid[cpu], fpregs); | ||
185 | if (err) | 183 | if (err) |
186 | return err; | 184 | return err; |
187 | 185 | ||
188 | n = copy_to_user(buf, fpregs, sizeof(fpregs)); | 186 | n = copy_to_user(buf, &fpregs, sizeof(fpregs)); |
189 | if(n > 0) | 187 | if(n > 0) |
190 | return -EFAULT; | 188 | return -EFAULT; |
191 | 189 | ||
@@ -195,14 +193,14 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | |||
195 | int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | 193 | int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) |
196 | { | 194 | { |
197 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 195 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
198 | long fpregs[HOST_XFP_SIZE]; | 196 | struct user_fxsr_struct fpregs; |
199 | 197 | ||
200 | BUG_ON(sizeof(*buf) != sizeof(fpregs)); | 198 | n = copy_from_user(&fpregs, buf, sizeof(fpregs)); |
201 | n = copy_from_user(fpregs, buf, sizeof(fpregs)); | ||
202 | if (n > 0) | 199 | if (n > 0) |
203 | return -EFAULT; | 200 | return -EFAULT; |
204 | 201 | ||
205 | return restore_fpx_registers(userspace_pid[cpu], fpregs); | 202 | return restore_fpx_registers(userspace_pid[cpu], |
203 | (unsigned long *) &fpregs); | ||
206 | } | 204 | } |
207 | 205 | ||
208 | long subarch_ptrace(struct task_struct *child, long request, long addr, | 206 | long subarch_ptrace(struct task_struct *child, long request, long addr, |