diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-11-30 17:37:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:44:29 -0500 |
commit | f8b7256096a20436f6d0926747e3ac3d64c81d24 (patch) | |
tree | 18bcabd1de263bd2d0f8d6b763bde8b037716c5c /arch/avr32/kernel | |
parent | 0067bd8a55862ac9dd212bd1c4f6f5bff1ca1301 (diff) |
Unify sys_mmap*
New helper - sys_mmap_pgoff(); switch syscalls to using it.
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/avr32/kernel')
-rw-r--r-- | arch/avr32/kernel/sys_avr32.c | 31 | ||||
-rw-r--r-- | arch/avr32/kernel/syscall-stubs.S | 2 |
2 files changed, 1 insertions, 32 deletions
diff --git a/arch/avr32/kernel/sys_avr32.c b/arch/avr32/kernel/sys_avr32.c index 5d2daeaf356f..459349b5ed5a 100644 --- a/arch/avr32/kernel/sys_avr32.c +++ b/arch/avr32/kernel/sys_avr32.c | |||
@@ -5,39 +5,8 @@ | |||
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | #include <linux/errno.h> | ||
9 | #include <linux/fs.h> | ||
10 | #include <linux/file.h> | ||
11 | #include <linux/mm.h> | ||
12 | #include <linux/unistd.h> | 8 | #include <linux/unistd.h> |
13 | 9 | ||
14 | #include <asm/mman.h> | ||
15 | #include <asm/uaccess.h> | ||
16 | #include <asm/syscalls.h> | ||
17 | |||
18 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
19 | unsigned long prot, unsigned long flags, | ||
20 | unsigned long fd, off_t offset) | ||
21 | { | ||
22 | int error = -EBADF; | ||
23 | struct file *file = NULL; | ||
24 | |||
25 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
26 | if (!(flags & MAP_ANONYMOUS)) { | ||
27 | file = fget(fd); | ||
28 | if (!file) | ||
29 | return error; | ||
30 | } | ||
31 | |||
32 | down_write(¤t->mm->mmap_sem); | ||
33 | error = do_mmap_pgoff(file, addr, len, prot, flags, offset); | ||
34 | up_write(¤t->mm->mmap_sem); | ||
35 | |||
36 | if (file) | ||
37 | fput(file); | ||
38 | return error; | ||
39 | } | ||
40 | |||
41 | int kernel_execve(const char *file, char **argv, char **envp) | 10 | int kernel_execve(const char *file, char **argv, char **envp) |
42 | { | 11 | { |
43 | register long scno asm("r8") = __NR_execve; | 12 | register long scno asm("r8") = __NR_execve; |
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S index f7244cd02fbb..0447a3e2ba64 100644 --- a/arch/avr32/kernel/syscall-stubs.S +++ b/arch/avr32/kernel/syscall-stubs.S | |||
@@ -61,7 +61,7 @@ __sys_execve: | |||
61 | __sys_mmap2: | 61 | __sys_mmap2: |
62 | pushm lr | 62 | pushm lr |
63 | st.w --sp, ARG6 | 63 | st.w --sp, ARG6 |
64 | call sys_mmap2 | 64 | call sys_mmap_pgoff |
65 | sub sp, -4 | 65 | sub sp, -4 |
66 | popm pc | 66 | popm pc |
67 | 67 | ||