#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,
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
- if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS)
- goto out;
-
error = -EBADF;
if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd);
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(¤t->mm->mmap_sem);
- ret = do_mremap(addr, old_len, new_len, flags, new_addr);
- up_write(¤t->mm->mmap_sem);
-
-out:
- return ret;
-}
-
/*
* Perform the select(nd, in, out, ex, tv) and mmap() system
* calls.