aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/sched.h7
-rw-r--r--mm/nommu.c21
-rw-r--r--mm/util.c2
4 files changed, 8 insertions, 24 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 80cfa78a8cf6..36f96271306c 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -205,10 +205,12 @@ struct mm_struct {
205 struct vm_area_struct * mmap; /* list of VMAs */ 205 struct vm_area_struct * mmap; /* list of VMAs */
206 struct rb_root mm_rb; 206 struct rb_root mm_rb;
207 struct vm_area_struct * mmap_cache; /* last find_vma result */ 207 struct vm_area_struct * mmap_cache; /* last find_vma result */
208#ifdef CONFIG_MMU
208 unsigned long (*get_unmapped_area) (struct file *filp, 209 unsigned long (*get_unmapped_area) (struct file *filp,
209 unsigned long addr, unsigned long len, 210 unsigned long addr, unsigned long len,
210 unsigned long pgoff, unsigned long flags); 211 unsigned long pgoff, unsigned long flags);
211 void (*unmap_area) (struct mm_struct *mm, unsigned long addr); 212 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
213#endif
212 unsigned long mmap_base; /* base of mmap area */ 214 unsigned long mmap_base; /* base of mmap area */
213 unsigned long task_size; /* size of task vm space */ 215 unsigned long task_size; /* size of task vm space */
214 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ 216 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8d4991be9d53..6f7bba93929b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -377,6 +377,8 @@ extern int sysctl_max_map_count;
377 377
378#include <linux/aio.h> 378#include <linux/aio.h>
379 379
380#ifdef CONFIG_MMU
381extern void arch_pick_mmap_layout(struct mm_struct *mm);
380extern unsigned long 382extern unsigned long
381arch_get_unmapped_area(struct file *, unsigned long, unsigned long, 383arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
382 unsigned long, unsigned long); 384 unsigned long, unsigned long);
@@ -386,6 +388,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
386 unsigned long flags); 388 unsigned long flags);
387extern void arch_unmap_area(struct mm_struct *, unsigned long); 389extern void arch_unmap_area(struct mm_struct *, unsigned long);
388extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 390extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
391#else
392static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
393#endif
389 394
390#if USE_SPLIT_PTLOCKS 395#if USE_SPLIT_PTLOCKS
391/* 396/*
@@ -2491,8 +2496,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
2491 2496
2492#endif /* CONFIG_SMP */ 2497#endif /* CONFIG_SMP */
2493 2498
2494extern void arch_pick_mmap_layout(struct mm_struct *mm);
2495
2496#ifdef CONFIG_TRACING 2499#ifdef CONFIG_TRACING
2497extern void 2500extern void
2498__trace_special(void *__tr, void *__data, 2501__trace_special(void *__tr, void *__data,
diff --git a/mm/nommu.c b/mm/nommu.c
index d6dd656264a2..32be0cf51ba6 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1761,27 +1761,6 @@ void unmap_mapping_range(struct address_space *mapping,
1761EXPORT_SYMBOL(unmap_mapping_range); 1761EXPORT_SYMBOL(unmap_mapping_range);
1762 1762
1763/* 1763/*
1764 * ask for an unmapped area at which to create a mapping on a file
1765 */
1766unsigned long get_unmapped_area(struct file *file, unsigned long addr,
1767 unsigned long len, unsigned long pgoff,
1768 unsigned long flags)
1769{
1770 unsigned long (*get_area)(struct file *, unsigned long, unsigned long,
1771 unsigned long, unsigned long);
1772
1773 get_area = current->mm->get_unmapped_area;
1774 if (file && file->f_op && file->f_op->get_unmapped_area)
1775 get_area = file->f_op->get_unmapped_area;
1776
1777 if (!get_area)
1778 return -ENOSYS;
1779
1780 return get_area(file, addr, len, pgoff, flags);
1781}
1782EXPORT_SYMBOL(get_unmapped_area);
1783
1784/*
1785 * Check that a process has enough memory to allocate a new virtual 1764 * Check that a process has enough memory to allocate a new virtual
1786 * mapping. 0 means there is enough memory for the allocation to 1765 * mapping. 0 means there is enough memory for the allocation to
1787 * succeed and -ENOMEM implies there is not. 1766 * succeed and -ENOMEM implies there is not.
diff --git a/mm/util.c b/mm/util.c
index 7c35ad95f927..834db7be240f 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -220,7 +220,7 @@ char *strndup_user(const char __user *s, long n)
220} 220}
221EXPORT_SYMBOL(strndup_user); 221EXPORT_SYMBOL(strndup_user);
222 222
223#ifndef HAVE_ARCH_PICK_MMAP_LAYOUT 223#if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT)
224void arch_pick_mmap_layout(struct mm_struct *mm) 224void arch_pick_mmap_layout(struct mm_struct *mm)
225{ 225{
226 mm->mmap_base = TASK_UNMAPPED_BASE; 226 mm->mmap_base = TASK_UNMAPPED_BASE;