diff options
Diffstat (limited to 'arch/powerpc/kernel/ptrace.c')
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 21 |
1 files changed, 13 insertions, 8 deletions
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 |