arm: add arch_mmap_check(), get rid of sys_arm_mremap()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 30 Nov 2009 18:06:51 +0000 (13:06 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 11 Dec 2009 11:34:09 +0000 (06:34 -0500)
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm/include/asm/mman.h
arch/arm/kernel/calls.S
arch/arm/kernel/sys_arm.c

index 8eebf89f5ab17884a98543f3b37a3b710355083b..41f99c573b93c918843ccbcd50ea2640bcb5e3ac 100644 (file)
@@ -1 +1,4 @@
 #include <asm-generic/mman.h>
+
+#define arch_mmap_check(addr, len, flags) \
+       (((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)
index f58c1156e779f4a7caf94ea238a757c26d64e795..9314a2d681f15a299e614842c37eb97f694dbd23 100644 (file)
 /* 160 */      CALL(sys_sched_get_priority_min)
                CALL(sys_sched_rr_get_interval)
                CALL(sys_nanosleep)
-               CALL(sys_arm_mremap)
+               CALL(sys_mremap)
                CALL(sys_setresuid16)
 /* 165 */      CALL(sys_getresuid16)
                CALL(sys_ni_syscall)            /* vm86 */
index 78ecaac652069217b965eca0cd336b40858698b2..3b897444a9bd48e1b9cdd54d19f9dc80cdd8e516 100644 (file)
 #include <linux/ipc.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 */
 inline long do_mmap2(
        unsigned long addr, unsigned long len,
@@ -43,9 +39,6 @@ inline long do_mmap2(
 
        flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 
-       if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS)
-               goto out;
-
        error = -EBADF;
        if (!(flags & MAP_ANONYMOUS)) {
                file = fget(fd);
@@ -89,24 +82,6 @@ out:
        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
  * calls.