2 #include <sys/ptrace.h>
4 #include "sysdep/tls.h"
5 #include "uml-config.h"
7 /* TLS support - we basically rely on the host's one.*/
9 /* In TT mode, this should be called only by the tracing thread, and makes sense
10 * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
14 #ifndef PTRACE_GET_THREAD_AREA
15 #define PTRACE_GET_THREAD_AREA 25
18 #ifndef PTRACE_SET_THREAD_AREA
19 #define PTRACE_SET_THREAD_AREA 26
22 int os_set_thread_area(user_desc_t *info, int pid)
26 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
27 (unsigned long) info);
33 #ifdef UML_CONFIG_MODE_SKAS
35 int os_get_thread_area(user_desc_t *info, int pid)
39 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
40 (unsigned long) info);
48 #ifdef UML_CONFIG_MODE_TT
49 #include "linux/unistd.h"
51 static _syscall1(int, get_thread_area, user_desc_t *, u_info);
52 static _syscall1(int, set_thread_area, user_desc_t *, u_info);
54 int do_set_thread_area_tt(user_desc_t *info)
58 ret = set_thread_area(info);
65 int do_get_thread_area_tt(user_desc_t *info)
69 ret = get_thread_area(info);
76 #endif /* UML_CONFIG_MODE_TT */