]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/um/os-Linux/tls.c
uml: throw out CONFIG_MODE_TT
[karo-tx-linux.git] / arch / um / os-Linux / tls.c
1 #include <errno.h>
2 #include <unistd.h>
3 #include <sys/ptrace.h>
4 #include <sys/syscall.h>
5 #include <asm/ldt.h>
6 #include "sysdep/tls.h"
7 #include "uml-config.h"
8
9 /* TLS support - we basically rely on the host's one.*/
10
11 #ifndef PTRACE_GET_THREAD_AREA
12 #define PTRACE_GET_THREAD_AREA 25
13 #endif
14
15 #ifndef PTRACE_SET_THREAD_AREA
16 #define PTRACE_SET_THREAD_AREA 26
17 #endif
18
19 int os_set_thread_area(user_desc_t *info, int pid)
20 {
21         int ret;
22
23         ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
24                      (unsigned long) info);
25         if (ret < 0)
26                 ret = -errno;
27         return ret;
28 }
29
30 int os_get_thread_area(user_desc_t *info, int pid)
31 {
32         int ret;
33
34         ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
35                      (unsigned long) info);
36         if (ret < 0)
37                 ret = -errno;
38         return ret;
39 }