]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
arch: personality independent stack top
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 19 Jul 2007 08:48:14 +0000 (01:48 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 17:04:45 +0000 (10:04 -0700)
New arch macro STACK_TOP_MAX it gives the larges valid stack address for the
architecture in question.

It differs from STACK_TOP in that it will not distinguish between
personalities but will always return the largest possible address.

This is used to create the initial stack on execve, which we will move down to
the proper location once the binfmt code has figured out where that is.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ollie Wild <aaw@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 files changed:
include/asm-alpha/a.out.h
include/asm-arm/a.out.h
include/asm-arm26/a.out.h
include/asm-avr32/a.out.h
include/asm-cris/a.out.h
include/asm-frv/mem-layout.h
include/asm-h8300/a.out.h
include/asm-i386/a.out.h
include/asm-ia64/ustack.h
include/asm-m32r/a.out.h
include/asm-m68k/a.out.h
include/asm-mips/a.out.h
include/asm-parisc/a.out.h
include/asm-powerpc/a.out.h
include/asm-s390/a.out.h
include/asm-sh/a.out.h
include/asm-sh64/a.out.h
include/asm-sparc/a.out.h
include/asm-sparc64/a.out.h
include/asm-um/a.out.h
include/asm-x86_64/a.out.h
include/asm-xtensa/a.out.h

index d97daf42753d72092744207dbb69ecd61542f8fd..e43cf61649a9e07195e1ccf815b12bedf0d4376a 100644 (file)
@@ -101,6 +101,8 @@ struct exec
 #define STACK_TOP \
   (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
 
+#define STACK_TOP_MAX  0x00120000000UL
+
 #endif
 
 #endif /* __A_OUT_GNU_H__ */
index 3e5fe64c439492dc274871595370e7e51f4fa55e..d7165e86df25012d4e56ed99666dc2c7cbbad95f 100644 (file)
@@ -30,6 +30,7 @@ struct exec
 #ifdef __KERNEL__
 #define STACK_TOP      ((current->personality == PER_LINUX_32BIT) ? \
                         TASK_SIZE : TASK_SIZE_26)
+#define STACK_TOP_MAX  TASK_SIZE
 #endif
 
 #ifndef LIBRARY_START_TEXT
index 9b2702c42c87e9ca5cbbd6c28cc80b0b0b36a3f6..7167f54ae3fc586cc1abef42ace5e33ce2eab094 100644 (file)
@@ -29,6 +29,7 @@ struct exec
 
 #ifdef __KERNEL__
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 #endif
 
 #ifndef LIBRARY_START_TEXT
index 50bf6e31a1435510d37570cecb166bc2679da4dc..9f398ab28ed08c983934c7c08c0f598a52615700 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index 770734ce54a6bc515e3e0a65ebc25ed6975a57e8..919b34a084f8fe3967d1f0b54603a9cb232eab04 100644 (file)
@@ -8,6 +8,7 @@
 
 /* grabbed from the intel stuff  */   
 #define STACK_TOP TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 
 struct exec
index a025dd4514e78c3cec2ae8e19647a6006e3e14b5..aaf2a773d9d3d42070f221ca3443b24821a372cc 100644 (file)
@@ -60,6 +60,7 @@
  */
 #define BRK_BASE                       __UL(2 * 1024 * 1024 + PAGE_SIZE)
 #define STACK_TOP                      __UL(2 * 1024 * 1024)
+#define STACK_TOP_MAX  STACK_TOP
 
 /* userspace process size */
 #ifdef CONFIG_MMU
index 3c70939f9f003283927136657d72cb4ce711f5b6..aa5d22778235992f08155cf2229d6e12188b15ce 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index ab17bb8e546518e341213ce60fe05d6de5665a41..851a60f8258ca46b1c142a104ad74e7c09330184 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index a349467913ea834dbbebbb17dc5847f62f8b6440..504167c35b8be550d06d72f44c281ec11d434d64 100644 (file)
@@ -11,6 +11,7 @@
 /* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
 #define MAX_USER_STACK_SIZE    (RGN_MAP_LIMIT/2)
 #define STACK_TOP              (0x6000000000000000UL + RGN_MAP_LIMIT)
+#define STACK_TOP_MAX          STACK_TOP
 #endif
 
 /* Make a default stack size of 2GiB */
index 9a4a5d20160addb3f1e07db032b24f347d3d75ad..6a1b5d42f328c44231f8d0630f41f4b2a12d279f 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index eda1662773b889bdcd0323b2b4f34983e0bb88f9..6fc86a221a94702a8367e5952a7ab59805f14977 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index ef33c3f1348446ceb3ca5bb41b2ac81977fdf4ae..1ad60ba186d0e6d9a2500f7e98401147190158df 100644 (file)
@@ -40,6 +40,7 @@ struct exec
 #ifdef CONFIG_64BIT
 #define STACK_TOP      (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE)
 #endif
+#define STACK_TOP_MAX  TASK_SIZE
 
 #endif
 
index 2a490cc9ec91541e100630a3e7b79de1cd24e059..23e2c90943e58ade6c9deacd26a818bb70518973 100644 (file)
@@ -23,6 +23,7 @@ struct exec
  * prumpf */
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  DEFAULT_TASK_SIZE
 
 #endif
 
index c7393a977364c3868d98efeaa64304a997defba1..5c5ea83f934956c4f9e2166e95e170194602d29d 100644 (file)
@@ -26,9 +26,12 @@ struct exec
 #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
                   STACK_TOP_USER32 : STACK_TOP_USER64)
 
+#define STACK_TOP_MAX STACK_TOP_USER64
+
 #else /* __powerpc64__ */
 
 #define STACK_TOP TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif /* __powerpc64__ */
 #endif /* __KERNEL__ */
index 72adee6ef3383d4c0235f930308f354194178fbe..46158dcaf5178107a22701eb96a39c523b3b1b57 100644 (file)
@@ -32,6 +32,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  DEFAULT_TASK_SIZE
 
 #endif
 
index 6e9fca9ee33345bb1075cda1e7a75646589c3fe2..685d0f6125fab272d81ccc8220afc008777e89ff 100644 (file)
@@ -20,6 +20,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index e1995e86b663c2c986473df6a0c5a95820a3c590..237ee4e5b72a9966a6afb781744d5ae9be21fc9b 100644 (file)
@@ -31,6 +31,7 @@ struct exec
 #ifdef __KERNEL__
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif
 
index 9090060a23e66399d0286e85888a5caf345bbf79..917e04250696d065ef46bd5c3ae7c15be8b0123d 100644 (file)
@@ -92,6 +92,7 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
 #include <asm/page.h>
 
 #define STACK_TOP      (PAGE_OFFSET - PAGE_SIZE)
+#define STACK_TOP_MAX  STACK_TOP
 
 #endif /* __KERNEL__ */
 
index eb3b8e90b279a49af3972e8ed79d9fd60cc2dbfa..902e07f89a42a7ab125ee032775e1842a239efb6 100644 (file)
@@ -101,6 +101,8 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
 #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
                   STACK_TOP32 : STACK_TOP64)
 
+#define STACK_TOP_MAX STACK_TOP64
+
 #endif
 
 #endif /* !(__ASSEMBLY__) */
index 7016b893ac9d7feef84533d30475998902e53735..78bc9eed26b2b2b030171ab27fae694be72f9036 100644 (file)
@@ -17,4 +17,6 @@ extern int honeypot;
 #define STACK_TOP \
        CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
 
+#define STACK_TOP_MAX  STACK_TOP
+
 #endif
index 7255cde065384d9508507c88ac522fedfc9d36b2..e789300e41a5a6f3f3c5d2dc80cbe1828006a4b1 100644 (file)
@@ -21,7 +21,8 @@ struct exec
 
 #ifdef __KERNEL__
 #include <linux/thread_info.h>
-#define STACK_TOP TASK_SIZE
+#define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  TASK_SIZE64
 #endif
 
 #endif /* __A_OUT_GNU_H__ */
index ffc4dcfd6ac1da332420b3a9928fa229d76293e2..05a2f67c676853ecf8e09d33b257eedbd4ef47e0 100644 (file)
@@ -17,6 +17,7 @@
 /* Note: the kernel needs the a.out definitions, even if only ELF is used. */
 
 #define STACK_TOP      TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
 
 struct exec
 {