aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2009-02-21 20:50:00 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-22 23:53:06 -0500
commit13a2cb3694d7237e6cc3e94fcb311b81908ccd06 (patch)
treea2d0dfaa1b054059e0c384e05c97e3dff8ddb277
parenta465f9b694bcfa4957d06751c0274ded49421c82 (diff)
powerpc: Rearrange mmap.c
Rearrange mmap.c to better match the x86 version. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/mm/mmap.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
index 7db8abc01ef8..8ff5757af0d7 100644
--- a/arch/powerpc/mm/mmap.c
+++ b/arch/powerpc/mm/mmap.c
@@ -34,6 +34,17 @@
34#define MIN_GAP (128*1024*1024) 34#define MIN_GAP (128*1024*1024)
35#define MAX_GAP (TASK_SIZE/6*5) 35#define MAX_GAP (TASK_SIZE/6*5)
36 36
37static inline int mmap_is_legacy(void)
38{
39 if (current->personality & ADDR_COMPAT_LAYOUT)
40 return 1;
41
42 if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)
43 return 1;
44
45 return sysctl_legacy_va_layout;
46}
47
37static inline unsigned long mmap_base(void) 48static inline unsigned long mmap_base(void)
38{ 49{
39 unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; 50 unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
@@ -46,17 +57,6 @@ static inline unsigned long mmap_base(void)
46 return TASK_SIZE - (gap & PAGE_MASK); 57 return TASK_SIZE - (gap & PAGE_MASK);
47} 58}
48 59
49static inline int mmap_is_legacy(void)
50{
51 if (current->personality & ADDR_COMPAT_LAYOUT)
52 return 1;
53
54 if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)
55 return 1;
56
57 return sysctl_legacy_va_layout;
58}
59
60/* 60/*
61 * This function, called very early during the creation of a new 61 * This function, called very early during the creation of a new
62 * process VM image, sets up which VM layout function to use: 62 * process VM image, sets up which VM layout function to use: