summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/asm-x86_64/ia32.h1
-rw-r--r--include/asm-x86_64/processor.h4
-rw-r--r--include/linux/personality.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
index d558fc04fcdc..ef5ac9ab8e29 100644
--- a/include/asm-x86_64/ia32.h
+++ b/include/asm-x86_64/ia32.h
@@ -160,7 +160,6 @@ struct ustat32 {
char f_fpack[6];
};
-#define IA32_PAGE_OFFSET 0xffffe000
#define IA32_STACK_TOP IA32_PAGE_OFFSET
#ifdef __KERNEL__
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index e151dbb1e704..985941fcf75b 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -18,6 +18,7 @@
#include <asm/current.h>
#include <asm/system.h>
#include <asm/mmsegment.h>
+#include <linux/personality.h>
#define TF_MASK 0x00000100
#define IF_MASK 0x00000200
@@ -172,7 +173,8 @@ static inline void clear_in_cr4 (unsigned long mask)
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#define TASK_UNMAPPED_32 0xa0000000
+#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000)
+#define TASK_UNMAPPED_32 (IA32_PAGE_OFFSET / 3)
#define TASK_UNMAPPED_64 PAGE_ALIGN(TASK_SIZE/3)
#define TASK_UNMAPPED_BASE \
(test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64)
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 33802c8eeedb..14b91221d3e8 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -34,6 +34,7 @@ enum {
SHORT_INODE = 0x1000000,
WHOLE_SECONDS = 0x2000000,
STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000,
};
/*
@@ -56,6 +57,7 @@ enum {
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */