diff options
author | Robert Jennings <rcjenn@austin.ibm.com> | 2005-09-10 02:01:07 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-12 03:19:11 -0400 |
commit | 962bca7f389229a30ced441d7b37f55f203006a2 (patch) | |
tree | 9824ae5b923a477fb4a671eda60822f80610861e /arch/ppc64/kernel/ptrace32.c | |
parent | 4267292b0f368c1633ff3316a53b5f7fbada95f8 (diff) |
[PATCH] ppc64: Add PTRACE_{GET|SET}VRREGS
The ptrace get and set methods for VMX/Altivec registers present in the
ppc tree were missing for ppc64. This patch adds the 32-bit and
64-bit methods. Updated with the suggestions from Anton following the lines
of his code snippet.
Added:
- flush_altivec_to_thread calls as suggested by Anton
- piecewise copy of structure to preserve 32-bit vrsave data as per
Anton
(I consolidated the 32 and 64bit versions with 2 helper macros - Anton)
Signed-off-by: Robert C Jennings <rcjenn@austin.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel/ptrace32.c')
-rw-r--r-- | arch/ppc64/kernel/ptrace32.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c index 16436426c7e2..4d1568c946cc 100644 --- a/arch/ppc64/kernel/ptrace32.c +++ b/arch/ppc64/kernel/ptrace32.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * this archive for more details. | 17 | * this archive for more details. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/config.h> | ||
20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
22 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
@@ -409,6 +410,20 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) | |||
409 | ret = put_user(child->ptrace_message, (unsigned int __user *) data); | 410 | ret = put_user(child->ptrace_message, (unsigned int __user *) data); |
410 | break; | 411 | break; |
411 | 412 | ||
413 | #ifdef CONFIG_ALTIVEC | ||
414 | case PTRACE_GETVRREGS: | ||
415 | /* Get the child altivec register state. */ | ||
416 | flush_altivec_to_thread(child); | ||
417 | ret = get_vrregs((unsigned long __user *)data, child); | ||
418 | break; | ||
419 | |||
420 | case PTRACE_SETVRREGS: | ||
421 | /* Set the child altivec register state. */ | ||
422 | flush_altivec_to_thread(child); | ||
423 | ret = set_vrregs(child, (unsigned long __user *)data); | ||
424 | break; | ||
425 | #endif | ||
426 | |||
412 | default: | 427 | default: |
413 | ret = ptrace_request(child, request, addr, data); | 428 | ret = ptrace_request(child, request, addr, data); |
414 | break; | 429 | break; |