/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2011 Wind River Systems, * written by Ralf Baechle <ralf@linux-mips.org>
*/ #include <linux/compiler.h> #include <linux/elf-randomize.h> #include <linux/errno.h> #include <linux/mm.h> #include <linux/mman.h> #include <linux/export.h> #include <linux/personality.h> #include <linux/random.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h>
if (flags & MAP_FIXED) { /* Even MAP_FIXED mappings must reside within TASK_SIZE */ if (TASK_SIZE - len < addr) return -EINVAL;
/* * We do not accept a shared mapping if it would violate * cache aliasing constraints.
*/ if ((flags & MAP_SHARED) &&
((addr - (pgoff << PAGE_SHIFT)) & shm_align_mask)) return -EINVAL; return addr;
}
/* * A failed mmap() very likely causes application failure, * so fall back to the bottom-up function here. This scenario * can happen with large stack limits and large mmap() * allocations.
*/
}
/* * There is no need to export this but sched.h declares the function as * extern so making it static here results in an error.
*/ unsignedlong arch_get_unmapped_area_topdown(struct file *filp, unsignedlong addr0, unsignedlong len, unsignedlong pgoff, unsignedlong flags, vm_flags_t vm_flags)
{ return arch_get_unmapped_area_common(filp,
addr0, len, pgoff, flags, DOWN);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.