aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ptrace.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-06-26 03:07:48 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:43 -0400
commit9c75a31c3525a127f70b919856e32be3d8b03755 (patch)
tree3beee76d3dd4a55af868b5edfbef80c911819fed /arch/powerpc/kernel/ptrace.c
parent9e7511861c4f8d35852a3721c5bcd92661cb4c9f (diff)
powerpc: Add macros to access floating point registers in thread_struct.
We are going to change where the floating point registers are stored in the thread_struct, so in preparation add some macros to access the floating point registers. Update all code to use these new macros. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/ptrace.c')
-rw-r--r--arch/powerpc/kernel/ptrace.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 2a9fe97e4521..59ff08704e94 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -218,7 +218,7 @@ static int fpr_get(struct task_struct *target, const struct user_regset *regset,
218 flush_fp_to_thread(target); 218 flush_fp_to_thread(target);
219 219
220 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) != 220 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) !=
221 offsetof(struct thread_struct, fpr[32])); 221 offsetof(struct thread_struct, TS_FPR(32)));
222 222
223 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 223 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
224 &target->thread.fpr, 0, -1); 224 &target->thread.fpr, 0, -1);
@@ -231,7 +231,7 @@ static int fpr_set(struct task_struct *target, const struct user_regset *regset,
231 flush_fp_to_thread(target); 231 flush_fp_to_thread(target);
232 232
233 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) != 233 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) !=
234 offsetof(struct thread_struct, fpr[32])); 234 offsetof(struct thread_struct, TS_FPR(32)));
235 235
236 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 236 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
237 &target->thread.fpr, 0, -1); 237 &target->thread.fpr, 0, -1);
@@ -728,7 +728,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
728 tmp = ptrace_get_reg(child, (int) index); 728 tmp = ptrace_get_reg(child, (int) index);
729 } else { 729 } else {
730 flush_fp_to_thread(child); 730 flush_fp_to_thread(child);
731 tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0]; 731 tmp = ((unsigned long *)child->thread.fpr)
732 [TS_FPRWIDTH * (index - PT_FPR0)];
732 } 733 }
733 ret = put_user(tmp,(unsigned long __user *) data); 734 ret = put_user(tmp,(unsigned long __user *) data);
734 break; 735 break;
@@ -755,7 +756,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
755 ret = ptrace_put_reg(child, index, data); 756 ret = ptrace_put_reg(child, index, data);
756 } else { 757 } else {
757 flush_fp_to_thread(child); 758 flush_fp_to_thread(child);
758 ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data; 759 ((unsigned long *)child->thread.fpr)
760 [TS_FPRWIDTH * (index - PT_FPR0)] = data;
759 ret = 0; 761 ret = 0;
760 } 762 }
761 break; 763 break;