aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/sys_mn10300.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/kernel/sys_mn10300.c')
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index ec4100dfcb7d..17cc6ce04e84 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -23,42 +23,13 @@
23 23
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25 25
26/*
27 * memory mapping syscall
28 */
29asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
30 unsigned long prot, unsigned long flags,
31 unsigned long fd, unsigned long pgoff)
32{
33 struct file *file = NULL;
34 long error = -EINVAL;
35
36 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
37
38 error = -EBADF;
39 if (!(flags & MAP_ANONYMOUS)) {
40 file = fget(fd);
41 if (!file)
42 goto out;
43 }
44
45 down_write(&current->mm->mmap_sem);
46 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
47 up_write(&current->mm->mmap_sem);
48
49 if (file)
50 fput(file);
51out:
52 return error;
53}
54
55asmlinkage long old_mmap(unsigned long addr, unsigned long len, 26asmlinkage long old_mmap(unsigned long addr, unsigned long len,
56 unsigned long prot, unsigned long flags, 27 unsigned long prot, unsigned long flags,
57 unsigned long fd, unsigned long offset) 28 unsigned long fd, unsigned long offset)
58{ 29{
59 if (offset & ~PAGE_MASK) 30 if (offset & ~PAGE_MASK)
60 return -EINVAL; 31 return -EINVAL;
61 return sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 32 return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
62} 33}
63 34
64struct sel_arg_struct { 35struct sel_arg_struct {