2 #include <sys/ptrace.h>
3 #include <sys/syscall.h>
6 #include "sysdep/tls.h"
7 #include "uml-config.h"
9 /* TLS support - we basically rely on the host's one.*/
11 /* In TT mode, this should be called only by the tracing thread, and makes sense
12 * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
16 #ifndef PTRACE_GET_THREAD_AREA
17 #define PTRACE_GET_THREAD_AREA 25
20 #ifndef PTRACE_SET_THREAD_AREA
21 #define PTRACE_SET_THREAD_AREA 26
24 int os_set_thread_area(user_desc_t *info, int pid)
28 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
29 (unsigned long) info);
35 #ifdef UML_CONFIG_MODE_SKAS
37 int os_get_thread_area(user_desc_t *info, int pid)
41 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
42 (unsigned long) info);
50 #ifdef UML_CONFIG_MODE_TT
51 #include "linux/unistd.h"
53 int do_set_thread_area_tt(user_desc_t *info)
57 ret = syscall(__NR_set_thread_area,info);
64 int do_get_thread_area_tt(user_desc_t *info)
68 ret = syscall(__NR_get_thread_area,info);
75 #endif /* UML_CONFIG_MODE_TT */