mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
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>
This commit is contained in:
parent
a465f9b694
commit
13a2cb3694
@ -34,6 +34,17 @@
|
|||||||
#define MIN_GAP (128*1024*1024)
|
#define MIN_GAP (128*1024*1024)
|
||||||
#define MAX_GAP (TASK_SIZE/6*5)
|
#define MAX_GAP (TASK_SIZE/6*5)
|
||||||
|
|
||||||
|
static inline int mmap_is_legacy(void)
|
||||||
|
{
|
||||||
|
if (current->personality & ADDR_COMPAT_LAYOUT)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return sysctl_legacy_va_layout;
|
||||||
|
}
|
||||||
|
|
||||||
static inline unsigned long mmap_base(void)
|
static inline unsigned long mmap_base(void)
|
||||||
{
|
{
|
||||||
unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
|
unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
|
||||||
@ -46,17 +57,6 @@ static inline unsigned long mmap_base(void)
|
|||||||
return TASK_SIZE - (gap & PAGE_MASK);
|
return TASK_SIZE - (gap & PAGE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int mmap_is_legacy(void)
|
|
||||||
{
|
|
||||||
if (current->personality & ADDR_COMPAT_LAYOUT)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return sysctl_legacy_va_layout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function, called very early during the creation of a new
|
* This function, called very early during the creation of a new
|
||||||
* process VM image, sets up which VM layout function to use:
|
* process VM image, sets up which VM layout function to use:
|
||||||
|
Loading…
Reference in New Issue
Block a user