diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:09:49 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:15:17 -0400 |
commit | 1bbd5f21f426d99660ea8120b79595a282e5ff8a (patch) | |
tree | f9980460722d4f89ca468c7af92502daa82d8c1a /arch/um | |
parent | c5cc32fe14ccbc19484202d20cf7d6bad45e3567 (diff) |
um: merge os-Linux/tls.c into arch/x86/um/os-Linux/tls.c
it's i386-specific; moreover, analogs on other targets have
incompatible interface - PTRACE_GET_THREAD_AREA does exist
elsewhere, but struct user_desc does *not*
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/include/shared/os.h | 5 | ||||
-rw-r--r-- | arch/um/os-Linux/Makefile | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/tls.c | 35 |
3 files changed, 2 insertions, 42 deletions
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index caa66619a9b4..89b686c1a3ea 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "irq_user.h" | 10 | #include "irq_user.h" |
11 | #include "longjmp.h" | 11 | #include "longjmp.h" |
12 | #include "mm_id.h" | 12 | #include "mm_id.h" |
13 | #include "sysdep/tls.h" | ||
14 | 13 | ||
15 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) | 14 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) |
16 | 15 | ||
@@ -212,10 +211,6 @@ extern int run_helper_thread(int (*proc)(void *), void *arg, | |||
212 | extern int helper_wait(int pid); | 211 | extern int helper_wait(int pid); |
213 | 212 | ||
214 | 213 | ||
215 | /* tls.c */ | ||
216 | extern int os_set_thread_area(user_desc_t *info, int pid); | ||
217 | extern int os_get_thread_area(user_desc_t *info, int pid); | ||
218 | |||
219 | /* umid.c */ | 214 | /* umid.c */ |
220 | extern int umid_file_name(char *name, char *buf, int len); | 215 | extern int umid_file_name(char *name, char *buf, int len); |
221 | extern int set_umid(char *name); | 216 | extern int set_umid(char *name); |
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index 015d00057663..dd764101e488 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile | |||
@@ -5,13 +5,13 @@ | |||
5 | 5 | ||
6 | obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ | 6 | obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ |
7 | registers.o sigio.o signal.o start_up.o time.o tty.o \ | 7 | registers.o sigio.o signal.o start_up.o time.o tty.o \ |
8 | umid.o tls.o user_syms.o util.o drivers/ skas/ | 8 | umid.o user_syms.o util.o drivers/ skas/ |
9 | 9 | ||
10 | obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o | 10 | obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o |
11 | 11 | ||
12 | USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \ | 12 | USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \ |
13 | main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \ | 13 | main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \ |
14 | tty.o tls.o umid.o util.o | 14 | tty.o umid.o util.o |
15 | 15 | ||
16 | CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) | 16 | CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) |
17 | 17 | ||
diff --git a/arch/um/os-Linux/tls.c b/arch/um/os-Linux/tls.c deleted file mode 100644 index 73277801ef14..000000000000 --- a/arch/um/os-Linux/tls.c +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | #include <errno.h> | ||
2 | #include <sys/ptrace.h> | ||
3 | #include "sysdep/tls.h" | ||
4 | |||
5 | /* TLS support - we basically rely on the host's one.*/ | ||
6 | |||
7 | #ifndef PTRACE_GET_THREAD_AREA | ||
8 | #define PTRACE_GET_THREAD_AREA 25 | ||
9 | #endif | ||
10 | |||
11 | #ifndef PTRACE_SET_THREAD_AREA | ||
12 | #define PTRACE_SET_THREAD_AREA 26 | ||
13 | #endif | ||
14 | |||
15 | int os_set_thread_area(user_desc_t *info, int pid) | ||
16 | { | ||
17 | int ret; | ||
18 | |||
19 | ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number, | ||
20 | (unsigned long) info); | ||
21 | if (ret < 0) | ||
22 | ret = -errno; | ||
23 | return ret; | ||
24 | } | ||
25 | |||
26 | int os_get_thread_area(user_desc_t *info, int pid) | ||
27 | { | ||
28 | int ret; | ||
29 | |||
30 | ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number, | ||
31 | (unsigned long) info); | ||
32 | if (ret < 0) | ||
33 | ret = -errno; | ||
34 | return ret; | ||
35 | } | ||