aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-08 07:19:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:29 -0500
commit922a70d327bd4b11342c2afd08e20d35f52064c3 (patch)
treeaff7e43fa600363128c15c4b9a1ceba3869aac15 /include
parent3eb056764dd806bbe84eb604e45e7470feeaafd8 (diff)
aout: move STACK_TOP[_MAX] to asm/processor.h
Move STACK_TOP[_MAX] out of asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT format is available. Signed-off-by: David Howells <dhowells@redhat.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/a.out.h8
-rw-r--r--include/asm-alpha/processor.h5
-rw-r--r--include/asm-arm/a.out.h6
-rw-r--r--include/asm-arm/processor.h6
-rw-r--r--include/asm-avr32/a.out.h7
-rw-r--r--include/asm-avr32/processor.h5
-rw-r--r--include/asm-blackfin/a.out.h6
-rw-r--r--include/asm-blackfin/processor.h4
-rw-r--r--include/asm-cris/a.out.h6
-rw-r--r--include/asm-cris/processor.h3
-rw-r--r--include/asm-h8300/a.out.h7
-rw-r--r--include/asm-h8300/processor.h5
-rw-r--r--include/asm-ia64/a.out.h3
-rw-r--r--include/asm-m32r/a.out.h7
-rw-r--r--include/asm-m32r/processor.h5
-rw-r--r--include/asm-m68k/a.out.h7
-rw-r--r--include/asm-m68k/processor.h5
-rw-r--r--include/asm-mips/a.out.h13
-rw-r--r--include/asm-mips/processor.h7
-rw-r--r--include/asm-parisc/a.out.h10
-rw-r--r--include/asm-parisc/processor.h10
-rw-r--r--include/asm-powerpc/a.out.h19
-rw-r--r--include/asm-powerpc/processor.h19
-rw-r--r--include/asm-s390/a.out.h7
-rw-r--r--include/asm-s390/processor.h7
-rw-r--r--include/asm-sh/a.out.h7
-rw-r--r--include/asm-sh/processor_32.h3
-rw-r--r--include/asm-sh/processor_64.h3
-rw-r--r--include/asm-sparc/a.out.h9
-rw-r--r--include/asm-sparc/processor.h4
-rw-r--r--include/asm-sparc64/a.out.h12
-rw-r--r--include/asm-sparc64/processor.h12
-rw-r--r--include/asm-sparc64/user.h2
-rw-r--r--include/asm-um/a.out.h11
-rw-r--r--include/asm-um/processor-generic.h9
-rw-r--r--include/asm-x86/a.out.h10
-rw-r--r--include/asm-x86/processor.h5
-rw-r--r--include/asm-xtensa/a.out.h5
-rw-r--r--include/asm-xtensa/processor.h2
39 files changed, 121 insertions, 160 deletions
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
index e43cf61649a9..02ce8473870a 100644
--- a/include/asm-alpha/a.out.h
+++ b/include/asm-alpha/a.out.h
@@ -98,11 +98,5 @@ struct exec
98 set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \ 98 set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \
99 ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) 99 ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
100 100
101#define STACK_TOP \ 101#endif /* __KERNEL__ */
102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
103
104#define STACK_TOP_MAX 0x00120000000UL
105
106#endif
107
108#endif /* __A_OUT_GNU_H__ */ 102#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 425b7b6d28cb..94afe5859301 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -20,6 +20,11 @@
20 */ 20 */
21#define TASK_SIZE (0x40000000000UL) 21#define TASK_SIZE (0x40000000000UL)
22 22
23#define STACK_TOP \
24 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
25
26#define STACK_TOP_MAX 0x00120000000UL
27
23/* This decides where the kernel will search for a free chunk of vm 28/* This decides where the kernel will search for a free chunk of vm
24 * space during mmap's. 29 * space during mmap's.
25 */ 30 */
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
index d7165e86df25..79489fdcc8b8 100644
--- a/include/asm-arm/a.out.h
+++ b/include/asm-arm/a.out.h
@@ -27,12 +27,6 @@ struct exec
27 27
28#define M_ARM 103 28#define M_ARM 103
29 29
30#ifdef __KERNEL__
31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
32 TASK_SIZE : TASK_SIZE_26)
33#define STACK_TOP_MAX TASK_SIZE
34#endif
35
36#ifndef LIBRARY_START_TEXT 30#ifndef LIBRARY_START_TEXT
37#define LIBRARY_START_TEXT (0x00c00000) 31#define LIBRARY_START_TEXT (0x00c00000)
38#endif 32#endif
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 1bbf16182d62..bd8029e8dc67 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -22,6 +22,12 @@
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/types.h> 23#include <asm/types.h>
24 24
25#ifdef __KERNEL__
26#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
27 TASK_SIZE : TASK_SIZE_26)
28#define STACK_TOP_MAX TASK_SIZE
29#endif
30
25union debug_insn { 31union debug_insn {
26 u32 arm; 32 u32 arm;
27 u16 thumb; 33 u16 thumb;
diff --git a/include/asm-avr32/a.out.h b/include/asm-avr32/a.out.h
index 9f398ab28ed0..e46375a34a72 100644
--- a/include/asm-avr32/a.out.h
+++ b/include/asm-avr32/a.out.h
@@ -17,11 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
24
25#endif
26
27#endif /* __ASM_AVR32_A_OUT_H */ 20#endif /* __ASM_AVR32_A_OUT_H */
diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h
index 4212551c1cd9..49a88f5a9d2f 100644
--- a/include/asm-avr32/processor.h
+++ b/include/asm-avr32/processor.h
@@ -13,6 +13,11 @@
13 13
14#define TASK_SIZE 0x80000000 14#define TASK_SIZE 0x80000000
15 15
16#ifdef __KERNEL__
17#define STACK_TOP TASK_SIZE
18#define STACK_TOP_MAX STACK_TOP
19#endif
20
16#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
17 22
18static inline void *current_text_addr(void) 23static inline void *current_text_addr(void)
diff --git a/include/asm-blackfin/a.out.h b/include/asm-blackfin/a.out.h
index d37a6849bf74..6c3d652ebd33 100644
--- a/include/asm-blackfin/a.out.h
+++ b/include/asm-blackfin/a.out.h
@@ -16,10 +16,4 @@ struct exec {
16#define N_DRSIZE(a) ((a).a_drsize) 16#define N_DRSIZE(a) ((a).a_drsize)
17#define N_SYMSIZE(a) ((a).a_syms) 17#define N_SYMSIZE(a) ((a).a_syms)
18 18
19#ifdef __KERNEL__
20
21#define STACK_TOP TASK_SIZE
22
23#endif
24
25#endif /* __BFIN_A_OUT_H__ */ 19#endif /* __BFIN_A_OUT_H__ */
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
index c571e958558c..1033e5c76011 100644
--- a/include/asm-blackfin/processor.h
+++ b/include/asm-blackfin/processor.h
@@ -30,6 +30,10 @@ static inline void wrusp(unsigned long usp)
30extern unsigned long memory_end; 30extern unsigned long memory_end;
31#define TASK_SIZE (memory_end) 31#define TASK_SIZE (memory_end)
32 32
33#ifdef __KERNEL__
34#define STACK_TOP TASK_SIZE
35#endif
36
33#define TASK_UNMAPPED_BASE 0 37#define TASK_UNMAPPED_BASE 0
34 38
35struct thread_struct { 39struct thread_struct {
diff --git a/include/asm-cris/a.out.h b/include/asm-cris/a.out.h
index 919b34a084f8..c82e9f9b75f6 100644
--- a/include/asm-cris/a.out.h
+++ b/include/asm-cris/a.out.h
@@ -6,11 +6,6 @@
6 * wants to know about a.out even if there is no interpreter available... 6 * wants to know about a.out even if there is no interpreter available...
7 */ 7 */
8 8
9/* grabbed from the intel stuff */
10#define STACK_TOP TASK_SIZE
11#define STACK_TOP_MAX STACK_TOP
12
13
14struct exec 9struct exec
15{ 10{
16 unsigned long a_info; /* Use macros N_MAGIC, etc for access */ 11 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
@@ -28,5 +23,4 @@ struct exec
28#define N_DRSIZE(a) ((a).a_drsize) 23#define N_DRSIZE(a) ((a).a_drsize)
29#define N_SYMSIZE(a) ((a).a_syms) 24#define N_SYMSIZE(a) ((a).a_syms)
30 25
31
32#endif 26#endif
diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h
index 568da1deceb9..cdc0c1dce6be 100644
--- a/include/asm-cris/processor.h
+++ b/include/asm-cris/processor.h
@@ -17,6 +17,9 @@
17 17
18struct task_struct; 18struct task_struct;
19 19
20#define STACK_TOP TASK_SIZE
21#define STACK_TOP_MAX STACK_TOP
22
20/* This decides where the kernel will search for a free chunk of vm 23/* This decides where the kernel will search for a free chunk of vm
21 * space during mmap's. 24 * space during mmap's.
22 */ 25 */
diff --git a/include/asm-h8300/a.out.h b/include/asm-h8300/a.out.h
index aa5d22778235..ded780f0a492 100644
--- a/include/asm-h8300/a.out.h
+++ b/include/asm-h8300/a.out.h
@@ -17,11 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
24
25#endif
26
27#endif /* __H8300_A_OUT_H__ */ 20#endif /* __H8300_A_OUT_H__ */
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index 49fc886a6232..69e8a34eb6d5 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -39,6 +39,11 @@ static inline void wrusp(unsigned long usp) {
39 */ 39 */
40#define TASK_SIZE (0xFFFFFFFFUL) 40#define TASK_SIZE (0xFFFFFFFFUL)
41 41
42#ifdef __KERNEL__
43#define STACK_TOP TASK_SIZE
44#define STACK_TOP_MAX STACK_TOP
45#endif
46
42/* 47/*
43 * This decides where the kernel will search for a free chunk of vm 48 * This decides where the kernel will search for a free chunk of vm
44 * space during mmap's. We won't be using it 49 * space during mmap's. We won't be using it
diff --git a/include/asm-ia64/a.out.h b/include/asm-ia64/a.out.h
index 7293ac1df3ab..193dcfb67596 100644
--- a/include/asm-ia64/a.out.h
+++ b/include/asm-ia64/a.out.h
@@ -29,7 +29,4 @@ struct exec {
29#define N_SYMSIZE(x) 0 29#define N_SYMSIZE(x) 0
30#define N_TXTOFF(x) 0 30#define N_TXTOFF(x) 0
31 31
32#ifdef __KERNEL__
33#include <asm/ustack.h>
34#endif
35#endif /* _ASM_IA64_A_OUT_H */ 32#endif /* _ASM_IA64_A_OUT_H */
diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h
index 6a1b5d42f328..ab150f5c1666 100644
--- a/include/asm-m32r/a.out.h
+++ b/include/asm-m32r/a.out.h
@@ -17,11 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
24
25#endif
26
27#endif /* _ASM_M32R_A_OUT_H */ 20#endif /* _ASM_M32R_A_OUT_H */
diff --git a/include/asm-m32r/processor.h b/include/asm-m32r/processor.h
index 32755bf136de..1a997fc148a2 100644
--- a/include/asm-m32r/processor.h
+++ b/include/asm-m32r/processor.h
@@ -60,6 +60,11 @@ extern struct cpuinfo_m32r cpu_data[];
60#define TASK_SIZE (0x00400000UL) 60#define TASK_SIZE (0x00400000UL)
61#endif 61#endif
62 62
63#ifdef __KERNEL__
64#define STACK_TOP TASK_SIZE
65#define STACK_TOP_MAX STACK_TOP
66#endif
67
63/* This decides where the kernel will search for a free chunk of vm 68/* This decides where the kernel will search for a free chunk of vm
64 * space during mmap's. 69 * space during mmap's.
65 */ 70 */
diff --git a/include/asm-m68k/a.out.h b/include/asm-m68k/a.out.h
index 6fc86a221a94..3885fe43432a 100644
--- a/include/asm-m68k/a.out.h
+++ b/include/asm-m68k/a.out.h
@@ -17,11 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
24
25#endif
26
27#endif /* __M68K_A_OUT_H__ */ 20#endif /* __M68K_A_OUT_H__ */
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 4453ec379c5d..1f61ef53f0e0 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -41,6 +41,11 @@ static inline void wrusp(unsigned long usp)
41#define TASK_SIZE (0x0E000000UL) 41#define TASK_SIZE (0x0E000000UL)
42#endif 42#endif
43 43
44#ifdef __KERNEL__
45#define STACK_TOP TASK_SIZE
46#define STACK_TOP_MAX STACK_TOP
47#endif
48
44/* This decides where the kernel will search for a free chunk of vm 49/* This decides where the kernel will search for a free chunk of vm
45 * space during mmap's. 50 * space during mmap's.
46 */ 51 */
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index bf55a5b34bef..cad8371422ab 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -32,17 +32,4 @@ struct exec
32#define N_DRSIZE(a) ((a).a_drsize) 32#define N_DRSIZE(a) ((a).a_drsize)
33#define N_SYMSIZE(a) ((a).a_syms) 33#define N_SYMSIZE(a) ((a).a_syms)
34 34
35#ifdef __KERNEL__
36
37#ifdef CONFIG_32BIT
38#define STACK_TOP TASK_SIZE
39#endif
40#ifdef CONFIG_64BIT
41#define STACK_TOP \
42 (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
43#endif
44#define STACK_TOP_MAX TASK_SIZE
45
46#endif
47
48#endif /* _ASM_A_OUT_H */ 35#endif /* _ASM_A_OUT_H */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 36f42de59409..58cbac5a64e4 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -39,6 +39,7 @@ extern unsigned int vced_count, vcei_count;
39 * so don't change it unless you know what you are doing. 39 * so don't change it unless you know what you are doing.
40 */ 40 */
41#define TASK_SIZE 0x7fff8000UL 41#define TASK_SIZE 0x7fff8000UL
42#define STACK_TOP TASK_SIZE
42 43
43/* 44/*
44 * This decides where the kernel will search for a free chunk of vm 45 * This decides where the kernel will search for a free chunk of vm
@@ -57,6 +58,8 @@ extern unsigned int vced_count, vcei_count;
57 */ 58 */
58#define TASK_SIZE32 0x7fff8000UL 59#define TASK_SIZE32 0x7fff8000UL
59#define TASK_SIZE 0x10000000000UL 60#define TASK_SIZE 0x10000000000UL
61#define STACK_TOP \
62 (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
60 63
61/* 64/*
62 * This decides where the kernel will search for a free chunk of vm 65 * This decides where the kernel will search for a free chunk of vm
@@ -69,6 +72,10 @@ extern unsigned int vced_count, vcei_count;
69 (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) 72 (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
70#endif 73#endif
71 74
75#ifdef __KERNEL__
76#define STACK_TOP_MAX TASK_SIZE
77#endif
78
72#define NUM_FPU_REGS 32 79#define NUM_FPU_REGS 32
73 80
74typedef __u64 fpureg_t; 81typedef __u64 fpureg_t;
diff --git a/include/asm-parisc/a.out.h b/include/asm-parisc/a.out.h
index 23e2c90943e5..eb04e34c5bb1 100644
--- a/include/asm-parisc/a.out.h
+++ b/include/asm-parisc/a.out.h
@@ -17,14 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc.
23 * prumpf */
24
25#define STACK_TOP TASK_SIZE
26#define STACK_TOP_MAX DEFAULT_TASK_SIZE
27
28#endif
29
30#endif /* __A_OUT_GNU_H__ */ 20#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index 3bb06e898fde..3c9d34844c83 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -47,6 +47,16 @@
47#define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32 47#define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32
48#endif 48#endif
49 49
50#ifdef __KERNEL__
51
52/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc.
53 * prumpf */
54
55#define STACK_TOP TASK_SIZE
56#define STACK_TOP_MAX DEFAULT_TASK_SIZE
57
58#endif
59
50#ifndef __ASSEMBLY__ 60#ifndef __ASSEMBLY__
51 61
52/* 62/*
diff --git a/include/asm-powerpc/a.out.h b/include/asm-powerpc/a.out.h
index 5c5ea83f9349..89cead6b176e 100644
--- a/include/asm-powerpc/a.out.h
+++ b/include/asm-powerpc/a.out.h
@@ -17,23 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21#ifdef __powerpc64__
22
23#define STACK_TOP_USER64 TASK_SIZE_USER64
24#define STACK_TOP_USER32 TASK_SIZE_USER32
25
26#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
27 STACK_TOP_USER32 : STACK_TOP_USER64)
28
29#define STACK_TOP_MAX STACK_TOP_USER64
30
31#else /* __powerpc64__ */
32
33#define STACK_TOP TASK_SIZE
34#define STACK_TOP_MAX STACK_TOP
35
36#endif /* __powerpc64__ */
37#endif /* __KERNEL__ */
38
39#endif /* _ASM_POWERPC_A_OUT_H */ 20#endif /* _ASM_POWERPC_A_OUT_H */
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index 1f4765d6546f..fd98ca998b4f 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -113,6 +113,25 @@ extern struct task_struct *last_task_used_spe;
113 TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) 113 TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
114#endif 114#endif
115 115
116#ifdef __KERNEL__
117#ifdef __powerpc64__
118
119#define STACK_TOP_USER64 TASK_SIZE_USER64
120#define STACK_TOP_USER32 TASK_SIZE_USER32
121
122#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
123 STACK_TOP_USER32 : STACK_TOP_USER64)
124
125#define STACK_TOP_MAX STACK_TOP_USER64
126
127#else /* __powerpc64__ */
128
129#define STACK_TOP TASK_SIZE
130#define STACK_TOP_MAX STACK_TOP
131
132#endif /* __powerpc64__ */
133#endif /* __KERNEL__ */
134
116typedef struct { 135typedef struct {
117 unsigned long seg; 136 unsigned long seg;
118} mm_segment_t; 137} mm_segment_t;
diff --git a/include/asm-s390/a.out.h b/include/asm-s390/a.out.h
index 46158dcaf517..8d6bd9c2952e 100644
--- a/include/asm-s390/a.out.h
+++ b/include/asm-s390/a.out.h
@@ -29,11 +29,4 @@ struct exec
29#define N_DRSIZE(a) ((a).a_drsize) 29#define N_DRSIZE(a) ((a).a_drsize)
30#define N_SYMSIZE(a) ((a).a_syms) 30#define N_SYMSIZE(a) ((a).a_syms)
31 31
32#ifdef __KERNEL__
33
34#define STACK_TOP TASK_SIZE
35#define STACK_TOP_MAX DEFAULT_TASK_SIZE
36
37#endif
38
39#endif /* __A_OUT_GNU_H__ */ 32#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index dfec2d011c0d..e8785634cbdb 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -78,6 +78,13 @@ extern int get_cpu_capability(unsigned int *);
78 78
79#endif /* __s390x__ */ 79#endif /* __s390x__ */
80 80
81#ifdef __KERNEL__
82
83#define STACK_TOP TASK_SIZE
84#define STACK_TOP_MAX DEFAULT_TASK_SIZE
85
86#endif
87
81#define HAVE_ARCH_PICK_MMAP_LAYOUT 88#define HAVE_ARCH_PICK_MMAP_LAYOUT
82 89
83typedef struct { 90typedef struct {
diff --git a/include/asm-sh/a.out.h b/include/asm-sh/a.out.h
index 685d0f6125fa..1f93130e179c 100644
--- a/include/asm-sh/a.out.h
+++ b/include/asm-sh/a.out.h
@@ -17,11 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21
22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
24
25#endif
26
27#endif /* __ASM_SH_A_OUT_H */ 20#endif /* __ASM_SH_A_OUT_H */
diff --git a/include/asm-sh/processor_32.h b/include/asm-sh/processor_32.h
index a7edaa1a870c..df2d5b039ef4 100644
--- a/include/asm-sh/processor_32.h
+++ b/include/asm-sh/processor_32.h
@@ -50,6 +50,9 @@ extern struct sh_cpuinfo cpu_data[];
50 */ 50 */
51#define TASK_SIZE 0x7c000000UL 51#define TASK_SIZE 0x7c000000UL
52 52
53#define STACK_TOP TASK_SIZE
54#define STACK_TOP_MAX STACK_TOP
55
53/* This decides where the kernel will search for a free chunk of vm 56/* This decides where the kernel will search for a free chunk of vm
54 * space during mmap's. 57 * space during mmap's.
55 */ 58 */
diff --git a/include/asm-sh/processor_64.h b/include/asm-sh/processor_64.h
index 99c22b14a85b..eda4bef448e9 100644
--- a/include/asm-sh/processor_64.h
+++ b/include/asm-sh/processor_64.h
@@ -83,6 +83,9 @@ extern struct sh_cpuinfo cpu_data[];
83 */ 83 */
84#define TASK_SIZE 0x7ffff000UL 84#define TASK_SIZE 0x7ffff000UL
85 85
86#define STACK_TOP TASK_SIZE
87#define STACK_TOP_MAX STACK_TOP
88
86/* This decides where the kernel will search for a free chunk of vm 89/* This decides where the kernel will search for a free chunk of vm
87 * space during mmap's. 90 * space during mmap's.
88 */ 91 */
diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h
index 917e04250696..744cfe6c0de8 100644
--- a/include/asm-sparc/a.out.h
+++ b/include/asm-sparc/a.out.h
@@ -87,13 +87,4 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
87 87
88#define N_RELOCATION_INFO_DECLARED 1 88#define N_RELOCATION_INFO_DECLARED 1
89 89
90#ifdef __KERNEL__
91
92#include <asm/page.h>
93
94#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE)
95#define STACK_TOP_MAX STACK_TOP
96
97#endif /* __KERNEL__ */
98
99#endif /* __SPARC_A_OUT_H__ */ 90#endif /* __SPARC_A_OUT_H__ */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 6fbb3f0af8d8..40b1e41fdea7 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -33,6 +33,10 @@
33 * we can make our access_ok test faster 33 * we can make our access_ok test faster
34 */ 34 */
35#define TASK_SIZE PAGE_OFFSET 35#define TASK_SIZE PAGE_OFFSET
36#ifdef __KERNEL__
37#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE)
38#define STACK_TOP_MAX STACK_TOP
39#endif /* __KERNEL__ */
36 40
37struct task_struct; 41struct task_struct;
38 42
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
index 902e07f89a42..53c95bdfc66e 100644
--- a/include/asm-sparc64/a.out.h
+++ b/include/asm-sparc64/a.out.h
@@ -93,18 +93,6 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
93 93
94#define N_RELOCATION_INFO_DECLARED 1 94#define N_RELOCATION_INFO_DECLARED 1
95 95
96#ifdef __KERNEL__
97
98#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE)
99#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL))
100
101#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
102 STACK_TOP32 : STACK_TOP64)
103
104#define STACK_TOP_MAX STACK_TOP64
105
106#endif
107
108#endif /* !(__ASSEMBLY__) */ 96#endif /* !(__ASSEMBLY__) */
109 97
110#endif /* !(__SPARC64_A_OUT_H__) */ 98#endif /* !(__SPARC64_A_OUT_H__) */
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index 66dd2fa0e319..48e74965c6e5 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -36,7 +36,19 @@
36#else 36#else
37#define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3)) 37#define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3))
38#endif 38#endif
39
39#define TASK_SIZE ((unsigned long)-VPTE_SIZE) 40#define TASK_SIZE ((unsigned long)-VPTE_SIZE)
41#ifdef __KERNEL__
42
43#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE)
44#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL))
45
46#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
47 STACK_TOP32 : STACK_TOP64)
48
49#define STACK_TOP_MAX STACK_TOP64
50
51#endif
40 52
41#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
42 54
diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h
index fce4e857dfc3..02b138943837 100644
--- a/include/asm-sparc64/user.h
+++ b/include/asm-sparc64/user.h
@@ -8,7 +8,7 @@
8#ifndef _SPARC64_USER_H 8#ifndef _SPARC64_USER_H
9#define _SPARC64_USER_H 9#define _SPARC64_USER_H
10 10
11#include <asm/a.out.h> 11#include <linux/a.out.h>
12struct sunos_regs { 12struct sunos_regs {
13 unsigned int psr, pc, npc, y; 13 unsigned int psr, pc, npc, y;
14 unsigned int regs[15]; 14 unsigned int regs[15];
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index f42ff14577fa..754181ee8683 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -8,15 +8,4 @@
8 8
9#include "asm/arch/a.out.h" 9#include "asm/arch/a.out.h"
10 10
11#undef STACK_TOP
12#undef STACK_TOP_MAX
13
14extern unsigned long stacksizelim;
15
16#define STACK_ROOM (stacksizelim)
17
18#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
19
20#define STACK_TOP_MAX STACK_TOP
21
22#endif 11#endif
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index b7d9a16a7451..7a1624cdaf7e 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -94,6 +94,15 @@ static inline void mm_copy_segments(struct mm_struct *from_mm,
94 */ 94 */
95#define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK) 95#define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK)
96 96
97#undef STACK_TOP
98#undef STACK_TOP_MAX
99
100extern unsigned long stacksizelim;
101
102#define STACK_ROOM (stacksizelim)
103#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
104#define STACK_TOP_MAX STACK_TOP
105
97/* This decides where the kernel will search for a free chunk of vm 106/* This decides where the kernel will search for a free chunk of vm
98 * space during mmap's. 107 * space during mmap's.
99 */ 108 */
diff --git a/include/asm-x86/a.out.h b/include/asm-x86/a.out.h
index a62443e38eb8..4684f97a5bbd 100644
--- a/include/asm-x86/a.out.h
+++ b/include/asm-x86/a.out.h
@@ -17,14 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#ifdef __KERNEL__
21# include <linux/thread_info.h>
22# define STACK_TOP TASK_SIZE
23# ifdef CONFIG_X86_32
24# define STACK_TOP_MAX STACK_TOP
25# else
26# define STACK_TOP_MAX TASK_SIZE64
27# endif
28#endif
29
30#endif /* _ASM_X86_A_OUT_H */ 20#endif /* _ASM_X86_A_OUT_H */
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index ab4d0c2a3f8f..149920dcd341 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -719,6 +719,8 @@ static inline void prefetchw(const void *x)
719 * User space process size: 3GB (default). 719 * User space process size: 3GB (default).
720 */ 720 */
721#define TASK_SIZE (PAGE_OFFSET) 721#define TASK_SIZE (PAGE_OFFSET)
722#define STACK_TOP TASK_SIZE
723#define STACK_TOP_MAX STACK_TOP
722 724
723#define INIT_THREAD { \ 725#define INIT_THREAD { \
724 .sp0 = sizeof(init_stack) + (long)&init_stack, \ 726 .sp0 = sizeof(init_stack) + (long)&init_stack, \
@@ -802,6 +804,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
802#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ 804#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \
803 IA32_PAGE_OFFSET : TASK_SIZE64) 805 IA32_PAGE_OFFSET : TASK_SIZE64)
804 806
807#define STACK_TOP TASK_SIZE
808#define STACK_TOP_MAX TASK_SIZE64
809
805#define INIT_THREAD { \ 810#define INIT_THREAD { \
806 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 811 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \
807} 812}
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
index 05a2f67c6768..fdf13702924a 100644
--- a/include/asm-xtensa/a.out.h
+++ b/include/asm-xtensa/a.out.h
@@ -14,11 +14,6 @@
14#ifndef _XTENSA_A_OUT_H 14#ifndef _XTENSA_A_OUT_H
15#define _XTENSA_A_OUT_H 15#define _XTENSA_A_OUT_H
16 16
17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */
18
19#define STACK_TOP TASK_SIZE
20#define STACK_TOP_MAX STACK_TOP
21
22struct exec 17struct exec
23{ 18{
24 unsigned long a_info; 19 unsigned long a_info;
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
index 35145bcd96eb..96408f436624 100644
--- a/include/asm-xtensa/processor.h
+++ b/include/asm-xtensa/processor.h
@@ -34,6 +34,8 @@
34 */ 34 */
35 35
36#define TASK_SIZE __XTENSA_UL_CONST(0x40000000) 36#define TASK_SIZE __XTENSA_UL_CONST(0x40000000)
37#define STACK_TOP TASK_SIZE
38#define STACK_TOP_MAX STACK_TOP
37 39
38/* 40/*
39 * General exception cause assigned to debug exceptions. Debug exceptions go 41 * General exception cause assigned to debug exceptions. Debug exceptions go