diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h index e43cf61649a9e07195e1ccf815b12bedf0d4376a..02ce8473870a96c326b91fe8a8f321b0c734dc0f 100644 --- a/include/asm-alpha/a.out.h +++ b/include/asm-alpha/a.out.h @@ -98,11 +98,5 @@ struct exec set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \ ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) -#define STACK_TOP \ - (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) - -#define STACK_TOP_MAX 0x00120000000UL - -#endif - +#endif /* __KERNEL__ */ #endif /* __A_OUT_GNU_H__ */ diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index 425b7b6d28cbba8e99ec8c1bbd9af578b77752df..94afe5859301f272eb6dedf7343f6e877f8fd77c 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h @@ -20,6 +20,11 @@ */ #define TASK_SIZE (0x40000000000UL) +#define STACK_TOP \ + (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) + +#define STACK_TOP_MAX 0x00120000000UL + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h index d7165e86df25012d4e56ed99666dc2c7cbbad95f..79489fdcc8b812c4ba81e88dd4bd3692622efac5 100644 --- a/include/asm-arm/a.out.h +++ b/include/asm-arm/a.out.h @@ -27,12 +27,6 @@ struct exec #define M_ARM 103 -#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 #define LIBRARY_START_TEXT (0x00c00000) #endif diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 1bbf16182d62ab4bfabd3c13e065d8280c38ccd9..bd8029e8dc67fd19cc6ed02f5f62f0debb074dd1 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -22,6 +22,12 @@ #include #include +#ifdef __KERNEL__ +#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ + TASK_SIZE : TASK_SIZE_26) +#define STACK_TOP_MAX TASK_SIZE +#endif + union debug_insn { u32 arm; u16 thumb; diff --git a/include/asm-avr32/a.out.h b/include/asm-avr32/a.out.h index 9f398ab28ed08c983934c7c08c0f598a52615700..e46375a34a72f0dbda360b82ac68d9d038d88425 100644 --- a/include/asm-avr32/a.out.h +++ b/include/asm-avr32/a.out.h @@ -17,11 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif - #endif /* __ASM_AVR32_A_OUT_H */ diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h index 4212551c1cd9962d81268ed0e40e23e4ebefd0aa..49a88f5a9d2feda1c7b033cfd19c71453c6dd6bf 100644 --- a/include/asm-avr32/processor.h +++ b/include/asm-avr32/processor.h @@ -13,6 +13,11 @@ #define TASK_SIZE 0x80000000 +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif + #ifndef __ASSEMBLY__ static inline void *current_text_addr(void) diff --git a/include/asm-blackfin/a.out.h b/include/asm-blackfin/a.out.h index d37a6849bf74968d2e7d4b18c59fd6003e776150..6c3d652ebd33e02786bfe411cfa28f74b4e59c3f 100644 --- a/include/asm-blackfin/a.out.h +++ b/include/asm-blackfin/a.out.h @@ -16,10 +16,4 @@ struct exec { #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE - -#endif - #endif /* __BFIN_A_OUT_H__ */ diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h index c571e958558cde4876c663a7a084ffa74883f489..1033e5c7601190089dfbd6cf7a19b95d32e796d2 100644 --- a/include/asm-blackfin/processor.h +++ b/include/asm-blackfin/processor.h @@ -30,6 +30,10 @@ static inline void wrusp(unsigned long usp) extern unsigned long memory_end; #define TASK_SIZE (memory_end) +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#endif + #define TASK_UNMAPPED_BASE 0 struct thread_struct { diff --git a/include/asm-cris/a.out.h b/include/asm-cris/a.out.h index 919b34a084f8fe3967d1f0b54603a9cb232eab04..c82e9f9b75f68d8206b48dc4f6036f8726941e01 100644 --- a/include/asm-cris/a.out.h +++ b/include/asm-cris/a.out.h @@ -6,11 +6,6 @@ * wants to know about a.out even if there is no interpreter available... */ -/* grabbed from the intel stuff */ -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - - struct exec { unsigned long a_info; /* Use macros N_MAGIC, etc for access */ @@ -28,5 +23,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) - #endif diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h index 568da1deceb908d9f89f341b810954b3958d1487..cdc0c1dce6be32891de3092bdea19aca17972d75 100644 --- a/include/asm-cris/processor.h +++ b/include/asm-cris/processor.h @@ -17,6 +17,9 @@ struct task_struct; +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-h8300/a.out.h b/include/asm-h8300/a.out.h index aa5d22778235992f08155cf2229d6e12188b15ce..ded780f0a49235d741a9fda178f65fad1f5921c3 100644 --- a/include/asm-h8300/a.out.h +++ b/include/asm-h8300/a.out.h @@ -17,11 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif - #endif /* __H8300_A_OUT_H__ */ diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h index 49fc886a623278249302edf3c169c883526e8313..69e8a34eb6d589a4fd2f2e8bc950910a8549290f 100644 --- a/include/asm-h8300/processor.h +++ b/include/asm-h8300/processor.h @@ -39,6 +39,11 @@ static inline void wrusp(unsigned long usp) { */ #define TASK_SIZE (0xFFFFFFFFUL) +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif + /* * This decides where the kernel will search for a free chunk of vm * 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 7293ac1df3ab96446d67624e919288712fa174f3..193dcfb67596b41bd65461d3ff9f4a8a1e8fcd86 100644 --- a/include/asm-ia64/a.out.h +++ b/include/asm-ia64/a.out.h @@ -29,7 +29,4 @@ struct exec { #define N_SYMSIZE(x) 0 #define N_TXTOFF(x) 0 -#ifdef __KERNEL__ -#include -#endif #endif /* _ASM_IA64_A_OUT_H */ diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h index 6a1b5d42f328c44231f8d0630f41f4b2a12d279f..ab150f5c1666e6c543b1a508cd309b7804f490d0 100644 --- a/include/asm-m32r/a.out.h +++ b/include/asm-m32r/a.out.h @@ -17,11 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif - #endif /* _ASM_M32R_A_OUT_H */ diff --git a/include/asm-m32r/processor.h b/include/asm-m32r/processor.h index 32755bf136de83891063e6f672be1dc1e66be259..1a997fc148a2f8d3afbb426db84564413b296973 100644 --- a/include/asm-m32r/processor.h +++ b/include/asm-m32r/processor.h @@ -60,6 +60,11 @@ extern struct cpuinfo_m32r cpu_data[]; #define TASK_SIZE (0x00400000UL) #endif +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-m68k/a.out.h b/include/asm-m68k/a.out.h index 6fc86a221a94702a8367e5952a7ab59805f14977..3885fe43432a79089d22527d1617927aa6ecc5e8 100644 --- a/include/asm-m68k/a.out.h +++ b/include/asm-m68k/a.out.h @@ -17,11 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif - #endif /* __M68K_A_OUT_H__ */ diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h index 4453ec379c5dabd2e723f8b8105ca6066e2b6f14..1f61ef53f0e0b068f2962f0a22d0f1dd4899f964 100644 --- a/include/asm-m68k/processor.h +++ b/include/asm-m68k/processor.h @@ -41,6 +41,11 @@ static inline void wrusp(unsigned long usp) #define TASK_SIZE (0x0E000000UL) #endif +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h index bf55a5b34bef7458c3a69a7b7a05398dec7e8986..cad8371422abd8e083e8446482c6137b08e42ec8 100644 --- a/include/asm-mips/a.out.h +++ b/include/asm-mips/a.out.h @@ -32,17 +32,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#ifdef CONFIG_32BIT -#define STACK_TOP TASK_SIZE -#endif -#ifdef CONFIG_64BIT -#define STACK_TOP \ - (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) -#endif -#define STACK_TOP_MAX TASK_SIZE - -#endif - #endif /* _ASM_A_OUT_H */ diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 36f42de594094b73f5b60ffc2dc0f09ebdf20b1c..58cbac5a64e4472dd45e17c3cef7426b86dbf243 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -39,6 +39,7 @@ extern unsigned int vced_count, vcei_count; * so don't change it unless you know what you are doing. */ #define TASK_SIZE 0x7fff8000UL +#define STACK_TOP TASK_SIZE /* * This decides where the kernel will search for a free chunk of vm @@ -57,6 +58,8 @@ extern unsigned int vced_count, vcei_count; */ #define TASK_SIZE32 0x7fff8000UL #define TASK_SIZE 0x10000000000UL +#define STACK_TOP \ + (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) /* * This decides where the kernel will search for a free chunk of vm @@ -69,6 +72,10 @@ extern unsigned int vced_count, vcei_count; (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) #endif +#ifdef __KERNEL__ +#define STACK_TOP_MAX TASK_SIZE +#endif + #define NUM_FPU_REGS 32 typedef __u64 fpureg_t; diff --git a/include/asm-parisc/a.out.h b/include/asm-parisc/a.out.h index 23e2c90943e58ade6c9deacd26a818bb70518973..eb04e34c5bb1ed3a448c4148eb9c37d852925225 100644 --- a/include/asm-parisc/a.out.h +++ b/include/asm-parisc/a.out.h @@ -17,14 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc. - * prumpf */ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX DEFAULT_TASK_SIZE - -#endif - #endif /* __A_OUT_GNU_H__ */ diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index 3bb06e898fdef5f0ad27d66a7144ed2e945c6d06..3c9d34844c83e0f6f4939ed01d54887ce16b7b5d 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h @@ -47,6 +47,16 @@ #define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32 #endif +#ifdef __KERNEL__ + +/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc. + * prumpf */ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX DEFAULT_TASK_SIZE + +#endif + #ifndef __ASSEMBLY__ /* diff --git a/include/asm-powerpc/a.out.h b/include/asm-powerpc/a.out.h index 5c5ea83f934956c4f9e2166e95e170194602d29d..89cead6b176e3a33a8b1464c061ce8937c875e3d 100644 --- a/include/asm-powerpc/a.out.h +++ b/include/asm-powerpc/a.out.h @@ -17,23 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ -#ifdef __powerpc64__ - -#define STACK_TOP_USER64 TASK_SIZE_USER64 -#define STACK_TOP_USER32 TASK_SIZE_USER32 - -#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__ */ - #endif /* _ASM_POWERPC_A_OUT_H */ diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index 1f4765d6546fe0313b6bbc150ff38b509d6811ba..fd98ca998b4fa87cec01af7418af98c207a273eb 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; TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) #endif +#ifdef __KERNEL__ +#ifdef __powerpc64__ + +#define STACK_TOP_USER64 TASK_SIZE_USER64 +#define STACK_TOP_USER32 TASK_SIZE_USER32 + +#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__ */ + typedef struct { unsigned long seg; } mm_segment_t; diff --git a/include/asm-s390/a.out.h b/include/asm-s390/a.out.h index 46158dcaf5178107a22701eb96a39c523b3b1b57..8d6bd9c2952e400902c2b353ada7acb9f3d1e08f 100644 --- a/include/asm-s390/a.out.h +++ b/include/asm-s390/a.out.h @@ -29,11 +29,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX DEFAULT_TASK_SIZE - -#endif - #endif /* __A_OUT_GNU_H__ */ diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index dfec2d011c0d9aaf6971cf73fa194a933a4712cc..e8785634cbdbf99540d8fca6a843a016904178e8 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -78,6 +78,13 @@ extern int get_cpu_capability(unsigned int *); #endif /* __s390x__ */ +#ifdef __KERNEL__ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX DEFAULT_TASK_SIZE + +#endif + #define HAVE_ARCH_PICK_MMAP_LAYOUT typedef struct { diff --git a/include/asm-sh/a.out.h b/include/asm-sh/a.out.h index 685d0f6125fab272d81ccc8220afc008777e89ff..1f93130e179cb8bf7f6c10e164e3b3d2ec5f441f 100644 --- a/include/asm-sh/a.out.h +++ b/include/asm-sh/a.out.h @@ -17,11 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif - #endif /* __ASM_SH_A_OUT_H */ diff --git a/include/asm-sh/processor_32.h b/include/asm-sh/processor_32.h index a7edaa1a870cbe52dab58864e569a479cfcbd0e1..df2d5b039ef41ad5bfdf5bd0e99436461a49bb28 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[]; */ #define TASK_SIZE 0x7c000000UL +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-sh/processor_64.h b/include/asm-sh/processor_64.h index 99c22b14a85b1b20abea399446247119cd82997a..eda4bef448e9f867f70c23a31b9eaa2d5be2a8e4 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[]; */ #define TASK_SIZE 0x7ffff000UL +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h index 917e04250696d065ef46bd5c3ae7c15be8b0123d..744cfe6c0de8ffca0c3d61b06d7735df8488c89f 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 */ #define N_RELOCATION_INFO_DECLARED 1 -#ifdef __KERNEL__ - -#include - -#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) -#define STACK_TOP_MAX STACK_TOP - -#endif /* __KERNEL__ */ - #endif /* __SPARC_A_OUT_H__ */ diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 6fbb3f0af8d891a6b7e1fdc8b80c58970a0a5a4e..40b1e41fdea7037e8d361c372674dd8cb55e39de 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -33,6 +33,10 @@ * we can make our access_ok test faster */ #define TASK_SIZE PAGE_OFFSET +#ifdef __KERNEL__ +#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) +#define STACK_TOP_MAX STACK_TOP +#endif /* __KERNEL__ */ struct task_struct; diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h index 902e07f89a42a7ab125ee032775e1842a239efb6..53c95bdfc66eb5e005442e0db26bc3c34d7524a5 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 */ #define N_RELOCATION_INFO_DECLARED 1 -#ifdef __KERNEL__ - -#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) -#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) - -#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ - STACK_TOP32 : STACK_TOP64) - -#define STACK_TOP_MAX STACK_TOP64 - -#endif - #endif /* !(__ASSEMBLY__) */ #endif /* !(__SPARC64_A_OUT_H__) */ diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 66dd2fa0e319ef9025b849951887d2ee0775b04d..48e74965c6e57c08649435b25881b4999dfaf4df 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -36,7 +36,19 @@ #else #define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3)) #endif + #define TASK_SIZE ((unsigned long)-VPTE_SIZE) +#ifdef __KERNEL__ + +#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) +#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) + +#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ + STACK_TOP32 : STACK_TOP64) + +#define STACK_TOP_MAX STACK_TOP64 + +#endif #ifndef __ASSEMBLY__ diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h index fce4e857dfc30632b82d79f4fce9b4e338a953c2..02b138943837347e45112cf6f4f35f40ab216387 100644 --- a/include/asm-sparc64/user.h +++ b/include/asm-sparc64/user.h @@ -8,7 +8,7 @@ #ifndef _SPARC64_USER_H #define _SPARC64_USER_H -#include +#include struct sunos_regs { unsigned int psr, pc, npc, y; unsigned int regs[15]; diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h index f42ff14577fac4875228242f26128ae6659e92f0..754181ee86831433bcfcc4e2ba4ad78c516c6229 100644 --- a/include/asm-um/a.out.h +++ b/include/asm-um/a.out.h @@ -8,15 +8,4 @@ #include "asm/arch/a.out.h" -#undef STACK_TOP -#undef STACK_TOP_MAX - -extern unsigned long stacksizelim; - -#define STACK_ROOM (stacksizelim) - -#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE) - -#define STACK_TOP_MAX STACK_TOP - #endif diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h index b7d9a16a74511d74194515042f703ecf940e5f24..7a1624cdaf7e8be1552831ac2efe7cc435026ab4 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, */ #define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK) +#undef STACK_TOP +#undef STACK_TOP_MAX + +extern unsigned long stacksizelim; + +#define STACK_ROOM (stacksizelim) +#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE) +#define STACK_TOP_MAX STACK_TOP + /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ diff --git a/include/asm-x86/a.out.h b/include/asm-x86/a.out.h index a62443e38eb81bb4fd7f68802d042e1aac66a8b8..4684f97a5bbd1b1edce881a88e75393b580a2cd1 100644 --- a/include/asm-x86/a.out.h +++ b/include/asm-x86/a.out.h @@ -17,14 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#ifdef __KERNEL__ -# include -# define STACK_TOP TASK_SIZE -# ifdef CONFIG_X86_32 -# define STACK_TOP_MAX STACK_TOP -# else -# define STACK_TOP_MAX TASK_SIZE64 -# endif -#endif - #endif /* _ASM_X86_A_OUT_H */ diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index ab4d0c2a3f8f286b792e2b2b724c6186849fb5e3..149920dcd341520c21964883302a95668111e6a0 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h @@ -719,6 +719,8 @@ static inline void prefetchw(const void *x) * User space process size: 3GB (default). */ #define TASK_SIZE (PAGE_OFFSET) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP #define INIT_THREAD { \ .sp0 = sizeof(init_stack) + (long)&init_stack, \ @@ -802,6 +804,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ IA32_PAGE_OFFSET : TASK_SIZE64) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX TASK_SIZE64 + #define INIT_THREAD { \ .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ } diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h index 05a2f67c676853ecf8e09d33b257eedbd4ef47e0..fdf13702924ae6f2d23e1ba3af4f4c492cdd701b 100644 --- a/include/asm-xtensa/a.out.h +++ b/include/asm-xtensa/a.out.h @@ -14,11 +14,6 @@ #ifndef _XTENSA_A_OUT_H #define _XTENSA_A_OUT_H -/* 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 { unsigned long a_info; diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index 35145bcd96ebb034847768a5ff783e1c9d457432..96408f4366244a0010888c4e021bf5c09364eb4d 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h @@ -34,6 +34,8 @@ */ #define TASK_SIZE __XTENSA_UL_CONST(0x40000000) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP /* * General exception cause assigned to debug exceptions. Debug exceptions go