12 #include <linux/sysctl.h>
15 #include <asm/pgalloc.h>
17 #include <asm/tlbflush.h>
18 #include <asm/cacheflush.h>
19 #include <asm/mmu_context.h>
24 #define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
25 #define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
27 static unsigned long hugetlb_get_unmapped_area_bottomup(
struct file *filp,
38 if (test_thread_flag(TIF_32BIT))
39 task_size = STACK_TOP32;
85 hugetlb_get_unmapped_area_topdown(
struct file *filp,
const unsigned long addr0,
86 const unsigned long len,
87 const unsigned long pgoff,
88 const unsigned long flags)
92 unsigned long addr = addr0;
95 BUG_ON(!test_thread_flag(TIF_32BIT));
109 if (!vma || addr <= vma->vm_start) {
127 if (
likely(!vma || addr+len <= vma->vm_start)) {
138 }
while (
likely(len < vma->vm_start));
161 unsigned long len,
unsigned long pgoff,
unsigned long flags)
167 if (test_thread_flag(TIF_32BIT))
168 task_size = STACK_TOP32;
184 if (task_size - len >= addr &&
185 (!vma || addr + len <= vma->vm_start))
189 return hugetlb_get_unmapped_area_bottomup(file, addr, len,
192 return hugetlb_get_unmapped_area_topdown(file, addr, len,
197 unsigned long addr,
unsigned long sz)
216 pte = pte_alloc_map(mm,
NULL, pmd, addr);