/* * arch/sh/mm/mmap.c * * Copyright (C) 2008 - 2009 Paul Mundt * * 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.
*/ #include <linux/io.h> #include <linux/mm.h> #include <linux/sched/mm.h> #include <linux/mman.h> #include <linux/module.h> #include <asm/page.h> #include <asm/processor.h>
if (flags & MAP_FIXED) { /* 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;
}
if (flags & MAP_FIXED) { /* 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.
*/ if (addr & ~PAGE_MASK) {
VM_BUG_ON(addr != -ENOMEM);
info.flags = 0;
info.low_limit = TASK_UNMAPPED_BASE;
info.high_limit = TASK_SIZE;
addr = vm_unmapped_area(&info);
}
return addr;
} #endif/* CONFIG_MMU */
/* * You really shouldn't be using read() or write() on /dev/mem. This * might go away in the future.
*/ int valid_phys_addr_range(phys_addr_t addr, size_t count)
{ if (addr < __MEMORY_START) return 0; if (addr + count > __pa(high_memory)) return 0;
return 1;
}
int valid_mmap_phys_addr_range(unsignedlong pfn, size_t size)
{ return 1;
}
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.