From 6e6d74cfac782a3a4cb5111bd9c25cd95d6b7c6c Mon Sep 17 00:00:00 2001
From: Jeff Dike <jdike@addtoit.com>
Date: Sat, 10 Feb 2007 01:44:30 -0800
Subject: [PATCH] uml: x86_64 ptrace fixes

This patch fixes some missing ptrace bits on x86_64.  PTRACE_ARCH_PRCTL is
hooked up and implemented.  This required generalizing arch_prctl_skas
slightly to take a task_struct to modify.  Previously, it always operated on
current.

Reading and writing the debug registers is also enabled by un-ifdefing the
code that implements that.  It turns out that x86_64 is identical to i386, so
the same code can be used.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 arch/um/kernel/ptrace.c | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'arch/um/kernel/ptrace.c')

diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 9a77fb3c269..627742d8943 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -18,6 +18,7 @@
 #include "kern_util.h"
 #include "skas_ptrace.h"
 #include "sysdep/ptrace.h"
+#include "os.h"
 
 static inline void set_singlestepping(struct task_struct *child, int on)
 {
@@ -240,6 +241,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 		ret = 0;
 		break;
 	}
+#endif
+#ifdef PTRACE_ARCH_PRCTL
+        case PTRACE_ARCH_PRCTL:
+                /* XXX Calls ptrace on the host - needs some SMP thinking */
+                ret = arch_prctl_skas(child, data, (void *) addr);
+                break;
 #endif
 	default:
 		ret = ptrace_request(child, request, addr, data);
-- 
cgit v1.2.3-70-g09d2