aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/sys_arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/sys_arm.c')
-rw-r--r--arch/arm/kernel/sys_arm.c55
1 files changed, 1 insertions, 54 deletions
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 78ecaac65206..ae4027bd01bd 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -28,41 +28,6 @@
28#include <linux/ipc.h> 28#include <linux/ipc.h>
29#include <linux/uaccess.h> 29#include <linux/uaccess.h>
30 30
31extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
32 unsigned long new_len, unsigned long flags,
33 unsigned long new_addr);
34
35/* common code for old and new mmaps */
36inline long do_mmap2(
37 unsigned long addr, unsigned long len,
38 unsigned long prot, unsigned long flags,
39 unsigned long fd, unsigned long pgoff)
40{
41 int error = -EINVAL;
42 struct file * file = NULL;
43
44 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
45
46 if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS)
47 goto out;
48
49 error = -EBADF;
50 if (!(flags & MAP_ANONYMOUS)) {
51 file = fget(fd);
52 if (!file)
53 goto out;
54 }
55
56 down_write(&current->mm->mmap_sem);
57 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
58 up_write(&current->mm->mmap_sem);
59
60 if (file)
61 fput(file);
62out:
63 return error;
64}
65
66struct mmap_arg_struct { 31struct mmap_arg_struct {
67 unsigned long addr; 32 unsigned long addr;
68 unsigned long len; 33 unsigned long len;
@@ -84,29 +49,11 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
84 if (a.offset & ~PAGE_MASK) 49 if (a.offset & ~PAGE_MASK)
85 goto out; 50 goto out;
86 51
87 error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); 52 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
88out: 53out:
89 return error; 54 return error;
90} 55}
91 56
92asmlinkage unsigned long
93sys_arm_mremap(unsigned long addr, unsigned long old_len,
94 unsigned long new_len, unsigned long flags,
95 unsigned long new_addr)
96{
97 unsigned long ret = -EINVAL;
98
99 if (flags & MREMAP_FIXED && new_addr < FIRST_USER_ADDRESS)
100 goto out;
101
102 down_write(&current->mm->mmap_sem);
103 ret = do_mremap(addr, old_len, new_len, flags, new_addr);
104 up_write(&current->mm->mmap_sem);
105
106out:
107 return ret;
108}
109
110/* 57/*
111 * Perform the select(nd, in, out, ex, tv) and mmap() system 58 * Perform the select(nd, in, out, ex, tv) and mmap() system
112 * calls. 59 * calls.