diff options
author | Gennady Sharapov <Gennady.V.Sharapov@intel.com> | 2005-11-07 03:58:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:31 -0500 |
commit | bb578426253ab9950cc20b4e5dd6aefb5500144f (patch) | |
tree | cd1b874512440f739dc555a40efb5edd51de275b /arch/um/os-Linux | |
parent | 0e76422ca5f34bb43b97c0945646ef072bcc1776 (diff) |
[PATCH] uml: separate libc-dependent uaccess code
The serial UML OS-abstraction layer patch (um/kernel dir).
This moves all systemcalls from uaccess_user.c file under os-Linux dir
Signed-off-by: Gennady Sharapov <Gennady.V.Sharapov@intel.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/Makefile | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/uaccess.c | 32 |
2 files changed, 34 insertions, 2 deletions
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index d15ec2af6a22..d389c58b18b2 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile | |||
@@ -4,10 +4,10 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | obj-y = aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o time.o \ | 6 | obj-y = aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o time.o \ |
7 | tt.o tty.o user_syms.o drivers/ sys-$(SUBARCH)/ | 7 | tt.o tty.o uaccess.o user_syms.o drivers/ sys-$(SUBARCH)/ |
8 | 8 | ||
9 | USER_OBJS := aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o \ | 9 | USER_OBJS := aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o \ |
10 | time.o tt.o tty.o | 10 | time.o tt.o tty.o uaccess.o |
11 | 11 | ||
12 | elf_aux.o: $(ARCH_DIR)/kernel-offsets.h | 12 | elf_aux.o: $(ARCH_DIR)/kernel-offsets.h |
13 | CFLAGS_elf_aux.o += -I$(objtree)/arch/um | 13 | CFLAGS_elf_aux.o += -I$(objtree)/arch/um |
diff --git a/arch/um/os-Linux/uaccess.c b/arch/um/os-Linux/uaccess.c new file mode 100644 index 000000000000..38d710158c3d --- /dev/null +++ b/arch/um/os-Linux/uaccess.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) | ||
3 | * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #include <setjmp.h> | ||
8 | #include <string.h> | ||
9 | |||
10 | unsigned long __do_user_copy(void *to, const void *from, int n, | ||
11 | void **fault_addr, void **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 | sigjmp_buf jbuf; | ||
18 | *fault_catcher = &jbuf; | ||
19 | if(sigsetjmp(jbuf, 1) == 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 | |||