Commit 2ea1d13f authored by Al Viro's avatar Al Viro

arm: add arch_mmap_check(), get rid of sys_arm_mremap()

Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c4caa778
#include <asm-generic/mman.h> #include <asm-generic/mman.h>
#define arch_mmap_check(addr, len, flags) \
(((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
/* 160 */ CALL(sys_sched_get_priority_min) /* 160 */ CALL(sys_sched_get_priority_min)
CALL(sys_sched_rr_get_interval) CALL(sys_sched_rr_get_interval)
CALL(sys_nanosleep) CALL(sys_nanosleep)
CALL(sys_arm_mremap) CALL(sys_mremap)
CALL(sys_setresuid16) CALL(sys_setresuid16)
/* 165 */ CALL(sys_getresuid16) /* 165 */ CALL(sys_getresuid16)
CALL(sys_ni_syscall) /* vm86 */ CALL(sys_ni_syscall) /* vm86 */
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include <linux/ipc.h> #include <linux/ipc.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
unsigned long new_len, unsigned long flags,
unsigned long new_addr);
/* common code for old and new mmaps */ /* common code for old and new mmaps */
inline long do_mmap2( inline long do_mmap2(
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
...@@ -43,9 +39,6 @@ inline long do_mmap2( ...@@ -43,9 +39,6 @@ inline long do_mmap2(
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS)
goto out;
error = -EBADF; error = -EBADF;
if (!(flags & MAP_ANONYMOUS)) { if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd); file = fget(fd);
...@@ -89,24 +82,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) ...@@ -89,24 +82,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
return error; return error;
} }
asmlinkage unsigned long
sys_arm_mremap(unsigned long addr, unsigned long old_len,
unsigned long new_len, unsigned long flags,
unsigned long new_addr)
{
unsigned long ret = -EINVAL;
if (flags & MREMAP_FIXED && new_addr < FIRST_USER_ADDRESS)
goto out;
down_write(&current->mm->mmap_sem);
ret = do_mremap(addr, old_len, new_len, flags, new_addr);
up_write(&current->mm->mmap_sem);
out:
return ret;
}
/* /*
* Perform the select(nd, in, out, ex, tv) and mmap() system * Perform the select(nd, in, out, ex, tv) and mmap() system
* calls. * calls.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment