2 #include <sys/ptrace.h>
3 #include <sys/syscall.h>
5 #include "sysdep/tls.h"
6 #include "uml-config.h"
8 /* TLS support - we basically rely on the host's one.*/
10 /* In TT mode, this should be called only by the tracing thread, and makes sense
11 * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
15 #ifndef PTRACE_GET_THREAD_AREA
16 #define PTRACE_GET_THREAD_AREA 25
19 #ifndef PTRACE_SET_THREAD_AREA
20 #define PTRACE_SET_THREAD_AREA 26
23 int os_set_thread_area(user_desc_t *info, int pid)
27 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
28 (unsigned long) info);
34 #ifdef UML_CONFIG_MODE_SKAS
36 int os_get_thread_area(user_desc_t *info, int pid)
40 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
41 (unsigned long) info);
49 #ifdef UML_CONFIG_MODE_TT
50 #include "linux/unistd.h"
52 int do_set_thread_area_tt(user_desc_t *info)
56 ret = syscall(__NR_set_thread_area,info);
63 int do_get_thread_area_tt(user_desc_t *info)
67 ret = syscall(__NR_get_thread_area,info);
74 #endif /* UML_CONFIG_MODE_TT */