aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ptrace_64.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-01-30 13:30:46 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:30:46 +0100
commitefd1ca52d04d2f6df337a3332cee56cd60e6d4c4 (patch)
treecf1e630d25cc45f399388f5fc996d86cf3bcf9ff /arch/x86/kernel/ptrace_64.c
parentx86: tls32 moved (diff)
downloadlinux-dev-efd1ca52d04d2f6df337a3332cee56cd60e6d4c4.tar.xz
linux-dev-efd1ca52d04d2f6df337a3332cee56cd60e6d4c4.zip
x86: TLS cleanup
This consolidates the four different places that implemented the same encoding magic for the GDT-slot 32-bit TLS support. The old tls32.c was renamed and is now only slightly modified to be the shared implementation. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Zachary Amsden <zach@vmware.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/ptrace_64.c')
-rw-r--r--arch/x86/kernel/ptrace_64.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/x86/kernel/ptrace_64.c b/arch/x86/kernel/ptrace_64.c
index 1edece36044c..375fadc23a25 100644
--- a/arch/x86/kernel/ptrace_64.c
+++ b/arch/x86/kernel/ptrace_64.c
@@ -474,23 +474,19 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
64bit debugger to fully examine them too. Better
don't use it against 64bit processes, use
PTRACE_ARCH_PRCTL instead. */
- case PTRACE_SET_THREAD_AREA: {
- struct user_desc __user *p;
- int old;
- p = (struct user_desc __user *)data;
- get_user(old, &p->entry_number);
- put_user(addr, &p->entry_number);
- ret = do_set_thread_area(&child->thread, p);
- put_user(old, &p->entry_number);
- break;
case PTRACE_GET_THREAD_AREA:
- p = (struct user_desc __user *)data;
- get_user(old, &p->entry_number);
- put_user(addr, &p->entry_number);
- ret = do_get_thread_area(&child->thread, p);
- put_user(old, &p->entry_number);
+ if (addr < 0)
+ return -EIO;
+ ret = do_get_thread_area(child, addr,
+ (struct user_desc __user *) data);
+
+ break;
+ case PTRACE_SET_THREAD_AREA:
+ if (addr < 0)
+ return -EIO;
+ ret = do_set_thread_area(child, addr,
+ (struct user_desc __user *) data, 0);
break;
- }
#endif
/* normal 64bit interface to access TLS data.
Works just like arch_prctl, except that the arguments