aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/process.c19
-rw-r--r--arch/powerpc/kernel/ptrace.c21
2 files changed, 14 insertions, 26 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index d52ded366f14..1924b57bd241 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -162,7 +162,7 @@ void flush_altivec_to_thread(struct task_struct *tsk)
162 } 162 }
163} 163}
164 164
165int dump_task_altivec(struct task_struct *tsk, elf_vrreg_t *vrregs) 165int dump_task_altivec(struct task_struct *tsk, elf_vrregset_t *vrregs)
166{ 166{
167 /* ELF_NVRREG includes the VSCR and VRSAVE which we need to save 167 /* ELF_NVRREG includes the VSCR and VRSAVE which we need to save
168 * separately, see below */ 168 * separately, see below */
@@ -249,23 +249,6 @@ int dump_task_vsx(struct task_struct *tsk, elf_vrreg_t *vrregs)
249} 249}
250#endif /* CONFIG_VSX */ 250#endif /* CONFIG_VSX */
251 251
252int dump_task_vector(struct task_struct *tsk, elf_vrregset_t *vrregs)
253{
254 int rc = 0;
255 elf_vrreg_t *regs = (elf_vrreg_t *)vrregs;
256#ifdef CONFIG_ALTIVEC
257 rc = dump_task_altivec(tsk, regs);
258 if (rc)
259 return rc;
260 regs += ELF_NVRREG;
261#endif
262
263#ifdef CONFIG_VSX
264 rc = dump_task_vsx(tsk, regs);
265#endif
266 return rc;
267}
268
269#ifdef CONFIG_SPE 252#ifdef CONFIG_SPE
270 253
271void enable_kernel_spe(void) 254void enable_kernel_spe(void)
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 4e203a89e189..8feb93e7890c 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -368,13 +368,15 @@ static int vsr_get(struct task_struct *target, const struct user_regset *regset,
368 unsigned int pos, unsigned int count, 368 unsigned int pos, unsigned int count,
369 void *kbuf, void __user *ubuf) 369 void *kbuf, void __user *ubuf)
370{ 370{
371 int ret; 371 double buf[32];
372 int ret, i;
372 373
373 flush_vsx_to_thread(target); 374 flush_vsx_to_thread(target);
374 375
376 for (i = 0; i < 32 ; i++)
377 buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
375 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, 378 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
376 target->thread.fpr, 0, 379 buf, 0, 32 * sizeof(double));
377 32 * sizeof(vector128));
378 380
379 return ret; 381 return ret;
380} 382}
@@ -383,13 +385,16 @@ static int vsr_set(struct task_struct *target, const struct user_regset *regset,
383 unsigned int pos, unsigned int count, 385 unsigned int pos, unsigned int count,
384 const void *kbuf, const void __user *ubuf) 386 const void *kbuf, const void __user *ubuf)
385{ 387{
386 int ret; 388 double buf[32];
389 int ret,i;
387 390
388 flush_vsx_to_thread(target); 391 flush_vsx_to_thread(target);
389 392
390 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, 393 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
391 target->thread.fpr, 0, 394 buf, 0, 32 * sizeof(double));
392 32 * sizeof(vector128)); 395 for (i = 0; i < 32 ; i++)
396 current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
397
393 398
394 return ret; 399 return ret;
395} 400}
@@ -499,8 +504,8 @@ static const struct user_regset native_regsets[] = {
499#endif 504#endif
500#ifdef CONFIG_VSX 505#ifdef CONFIG_VSX
501 [REGSET_VSX] = { 506 [REGSET_VSX] = {
502 .n = 32, 507 .core_note_type = NT_PPC_VSX, .n = 32,
503 .size = sizeof(vector128), .align = sizeof(vector128), 508 .size = sizeof(double), .align = sizeof(double),
504 .active = vsr_active, .get = vsr_get, .set = vsr_set 509 .active = vsr_active, .get = vsr_get, .set = vsr_set
505 }, 510 },
506#endif 511#endif