aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/ptrace.c
diff options
context:
space:
mode:
authorRobert Jennings <rcjenn@austin.ibm.com>2005-09-10 02:01:07 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-12 03:19:11 -0400
commit962bca7f389229a30ced441d7b37f55f203006a2 (patch)
tree9824ae5b923a477fb4a671eda60822f80610861e /arch/ppc64/kernel/ptrace.c
parent4267292b0f368c1633ff3316a53b5f7fbada95f8 (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/ptrace.c')
-rw-r--r--arch/ppc64/kernel/ptrace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c
index 2993f108d96d..bf7116d4c4c2 100644
--- a/arch/ppc64/kernel/ptrace.c
+++ b/arch/ppc64/kernel/ptrace.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>
@@ -274,6 +275,20 @@ int sys_ptrace(long request, long pid, long addr, long data)
274 break; 275 break;
275 } 276 }
276 277
278#ifdef CONFIG_ALTIVEC
279 case PTRACE_GETVRREGS:
280 /* Get the child altivec register state. */
281 flush_altivec_to_thread(child);
282 ret = get_vrregs((unsigned long __user *)data, child);
283 break;
284
285 case PTRACE_SETVRREGS:
286 /* Set the child altivec register state. */
287 flush_altivec_to_thread(child);
288 ret = set_vrregs(child, (unsigned long __user *)data);
289 break;
290#endif
291
277 default: 292 default:
278 ret = ptrace_request(child, request, addr, data); 293 ret = ptrace_request(child, request, addr, data);
279 break; 294 break;