mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
bitkeeper revision 1.1159.25.2 (411b9db3L6VLu1hZxOjZz_zsDqan8w)
Xen-specific get_unmapped_area checks.
This commit is contained in:
1 parent
4037eca6ae
commit
98da9ccfdf
5 files changed
+1882
-1
No files matched your search
@@ -159,6 +159,7 @@
|
||||
40f562383SKvDStdtrvzr5fyCbW4rw linux-2.6.7-xen-sparse/arch/xen/i386/mm/hypervisor.c
|
||||
40f56239xcNylAxuGsQHwi1AyMLV8w linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c
|
||||
41062ab7CjxC1UBaFhOMWWdhHkIUyg linux-2.6.7-xen-sparse/arch/xen/i386/mm/ioremap.c
|
||||
411b9db3oFpYQc4C-_mO2lRTcSz8UQ linux-2.6.7-xen-sparse/arch/xen/i386/mm/mmap.c
|
||||
40f5623906UYHv1rsVUeRc0tFT0dWw linux-2.6.7-xen-sparse/arch/xen/i386/mm/pgtable.c
|
||||
4107adf12ndy94MidCaivDibJ3pPAg linux-2.6.7-xen-sparse/arch/xen/i386/pci/Makefile
|
||||
4107adf1WcCgkhsdLTRGX52cOG1vJg linux-2.6.7-xen-sparse/arch/xen/i386/pci/direct.c
|
||||
@@ -241,6 +242,7 @@
|
||||
3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.6.7-xen-sparse/include/asm-xen/suspend.h
|
||||
3f689063BoW-HWV3auUJ-OqXfcGArw linux-2.6.7-xen-sparse/include/asm-xen/xen_proc.h
|
||||
40f56a0ddHCSs3501MY4hRf22tctOw linux-2.6.7-xen-sparse/mkbuildtree
|
||||
411b9db3dpQAK-pcP8WwcRHZGn2eKg linux-2.6.7-xen-sparse/mm/mmap.c
|
||||
410a94a4KT6I6X0LVc7djB39tRDp4g linux-2.6.7-xen-sparse/mm/page_alloc.c
|
||||
40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Make.defs
|
||||
3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
|
||||
|
||||
@@ -6,7 +6,7 @@ XENARCH := $(subst ",,$(CONFIG_XENARCH))
|
||||
|
||||
CFLAGS += -Iarch/$(XENARCH)/mm
|
||||
|
||||
obj-y := init.o fault.o ioremap.o pgtable.o hypervisor.o
|
||||
obj-y := init.o fault.o ioremap.o pgtable.o hypervisor.o mmap.o
|
||||
c-obj-y := extable.o pageattr.o
|
||||
|
||||
c-obj-$(CONFIG_DISCONTIGMEM) += discontig.o
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/pgalloc.h>
|
||||
|
||||
unsigned long
|
||||
arch_get_unmapped_area(struct file *filp, unsigned long addr,
|
||||
unsigned long len, unsigned long pgoff, unsigned long flags)
|
||||
{
|
||||
struct mm_struct *mm = current->mm;
|
||||
struct vm_area_struct *vma;
|
||||
unsigned long start_addr;
|
||||
|
||||
if (len > TASK_SIZE)
|
||||
return -ENOMEM;
|
||||
|
||||
if (addr) {
|
||||
addr = PAGE_ALIGN(addr);
|
||||
vma = find_vma(mm, addr);
|
||||
if (((TASK_SIZE - len) >= addr) &&
|
||||
(addr >= (FIRST_USER_PGD_NR<<PGDIR_SHIFT)) &&
|
||||
(!vma || ((addr + len) <= vma->vm_start)))
|
||||
return addr;
|
||||
}
|
||||
start_addr = addr = mm->free_area_cache;
|
||||
|
||||
full_search:
|
||||
for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
|
||||
/* At this point: (!vma || addr < vma->vm_end). */
|
||||
if (TASK_SIZE - len < addr) {
|
||||
/*
|
||||
* Start a new search - just in case we missed
|
||||
* some holes.
|
||||
*/
|
||||
if (start_addr != TASK_UNMAPPED_BASE) {
|
||||
start_addr = addr = TASK_UNMAPPED_BASE;
|
||||
goto full_search;
|
||||
}
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (!vma || addr + len <= vma->vm_start) {
|
||||
/*
|
||||
* Remember the place where we stopped the search:
|
||||
*/
|
||||
mm->free_area_cache = addr + len;
|
||||
return addr;
|
||||
}
|
||||
addr = vma->vm_end;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long
|
||||
arch_check_fixed_mapping(struct file *filp, unsigned long addr,
|
||||
unsigned long len, unsigned long pgoff, unsigned long flags)
|
||||
{
|
||||
if ( addr < (FIRST_USER_PGD_NR<<PGDIR_SHIFT) )
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
@@ -457,4 +457,7 @@ static inline unsigned long arbitrary_virt_to_phys(void *va)
|
||||
#define __HAVE_ARCH_PTE_SAME
|
||||
#include <asm-generic/pgtable.h>
|
||||
|
||||
#define HAVE_ARCH_UNMAPPED_AREA
|
||||
#define HAVE_ARCH_CHECK_FIXED_MAPPING
|
||||
|
||||
#endif /* _I386_PGTABLE_H */
|
||||
File diff suppressed because it is too large.
Load diff