diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:03:29 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:14:52 -0400 |
commit | 5d40de0f6e726dc9c48fb35815e0a6153e59e1dc (patch) | |
tree | 0a746d283d83d824eb88cbe19783d2939bd6e5ab | |
parent | 6582b7f7743da6ce3e3714e9e8b18e0e073d4acd (diff) |
um: kill dead code around uaccess
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r-- | arch/um/include/shared/os.h | 6 | ||||
-rw-r--r-- | arch/um/include/shared/um_uaccess.h | 3 | ||||
-rw-r--r-- | arch/um/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/um/kernel/uaccess.c | 33 | ||||
-rw-r--r-- | arch/um/os-Linux/Makefile | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/uaccess.c | 32 |
6 files changed, 3 insertions, 77 deletions
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 83c7c2ecd614..2e2663a8e910 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h | |||
@@ -203,12 +203,6 @@ extern int os_drop_memory(void *addr, int length); | |||
203 | extern int can_drop_memory(void); | 203 | extern int can_drop_memory(void); |
204 | extern void os_flush_stdout(void); | 204 | extern void os_flush_stdout(void); |
205 | 205 | ||
206 | /* uaccess.c */ | ||
207 | extern unsigned long __do_user_copy(void *to, const void *from, int n, | ||
208 | void **fault_addr, jmp_buf **fault_catcher, | ||
209 | void (*op)(void *to, const void *from, | ||
210 | int n), int *faulted_out); | ||
211 | |||
212 | /* execvp.c */ | 206 | /* execvp.c */ |
213 | extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); | 207 | extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); |
214 | /* helper.c */ | 208 | /* helper.c */ |
diff --git a/arch/um/include/shared/um_uaccess.h b/arch/um/include/shared/um_uaccess.h index 45c04999d670..51e1cce92d36 100644 --- a/arch/um/include/shared/um_uaccess.h +++ b/arch/um/include/shared/um_uaccess.h | |||
@@ -32,9 +32,6 @@ | |||
32 | extern int copy_from_user(void *to, const void __user *from, int n); | 32 | extern int copy_from_user(void *to, const void __user *from, int n); |
33 | extern int copy_to_user(void __user *to, const void *from, int n); | 33 | extern int copy_to_user(void __user *to, const void *from, int n); |
34 | 34 | ||
35 | extern int __do_copy_to_user(void *to, const void *from, int n, | ||
36 | void **fault_addr, jmp_buf **fault_catcher); | ||
37 | |||
38 | /* | 35 | /* |
39 | * strncpy_from_user: - Copy a NUL terminated string from userspace. | 36 | * strncpy_from_user: - Copy a NUL terminated string from userspace. |
40 | * @dst: Destination address, in kernel space. This buffer must be at | 37 | * @dst: Destination address, in kernel space. This buffer must be at |
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index c4491c15afb2..bc494741b1f3 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile | |||
@@ -11,7 +11,7 @@ clean-files := | |||
11 | 11 | ||
12 | obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \ | 12 | obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \ |
13 | physmem.o process.o ptrace.o reboot.o sigio.o \ | 13 | physmem.o process.o ptrace.o reboot.o sigio.o \ |
14 | signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \ | 14 | signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o \ |
15 | um_arch.o umid.o skas/ | 15 | um_arch.o umid.o skas/ |
16 | 16 | ||
17 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o | 17 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o |
diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c deleted file mode 100644 index dd33f040c526..000000000000 --- a/arch/um/kernel/uaccess.c +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) | ||
3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * These are here rather than tt/uaccess.c because skas mode needs them in | ||
9 | * order to do SIGBUS recovery when a tmpfs mount runs out of room. | ||
10 | */ | ||
11 | |||
12 | #include <linux/string.h> | ||
13 | #include "os.h" | ||
14 | |||
15 | static void __do_copy(void *to, const void *from, int n) | ||
16 | { | ||
17 | memcpy(to, from, n); | ||
18 | } | ||
19 | |||
20 | |||
21 | int __do_copy_to_user(void *to, const void *from, int n, | ||
22 | void **fault_addr, jmp_buf **fault_catcher) | ||
23 | { | ||
24 | unsigned long fault; | ||
25 | int faulted; | ||
26 | |||
27 | fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, | ||
28 | __do_copy, &faulted); | ||
29 | if (!faulted) | ||
30 | return 0; | ||
31 | else | ||
32 | return n - (fault - (unsigned long) to); | ||
33 | } | ||
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index b33f4dfe7ae5..7aec5bfea331 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile | |||
@@ -4,14 +4,14 @@ | |||
4 | # | 4 | # |
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 uaccess.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/ sys-$(SUBARCH)/ skas/ | 8 | umid.o tls.o user_syms.o util.o drivers/ sys-$(SUBARCH)/ 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 uaccess.o umid.o util.o | 14 | tty.o tls.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/uaccess.c b/arch/um/os-Linux/uaccess.c deleted file mode 100644 index 087ed74ffca5..000000000000 --- a/arch/um/os-Linux/uaccess.c +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) | ||
3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #include <stddef.h> | ||
8 | #include "longjmp.h" | ||
9 | |||
10 | unsigned long __do_user_copy(void *to, const void *from, int n, | ||
11 | void **fault_addr, jmp_buf **fault_catcher, | ||
12 | void (*op)(void *to, const void *from, | ||
13 | int n), int *faulted_out) | ||
14 | { | ||
15 | unsigned long *faddrp = (unsigned long *) fault_addr, ret; | ||
16 | |||
17 | jmp_buf jbuf; | ||
18 | *fault_catcher = &jbuf; | ||
19 | if (UML_SETJMP(&jbuf) == 0) { | ||
20 | (*op)(to, from, n); | ||
21 | ret = 0; | ||
22 | *faulted_out = 0; | ||
23 | } | ||
24 | else { | ||
25 | ret = *faddrp; | ||
26 | *faulted_out = 1; | ||
27 | } | ||
28 | *fault_addr = NULL; | ||
29 | *fault_catcher = NULL; | ||
30 | return ret; | ||
31 | } | ||
32 | |||