aout: move STACK_TOP[_MAX] to asm/processor.h
authorDavid Howells <dhowells@redhat.com>
Fri, 8 Feb 2008 12:19:26 +0000 (04:19 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:29 +0000 (09:22 -0800)
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>
39 files changed:
include/asm-alpha/a.out.h
include/asm-alpha/processor.h
include/asm-arm/a.out.h
include/asm-arm/processor.h
include/asm-avr32/a.out.h
include/asm-avr32/processor.h
include/asm-blackfin/a.out.h
include/asm-blackfin/processor.h
include/asm-cris/a.out.h
include/asm-cris/processor.h
include/asm-h8300/a.out.h
include/asm-h8300/processor.h
include/asm-ia64/a.out.h
include/asm-m32r/a.out.h
include/asm-m32r/processor.h
include/asm-m68k/a.out.h
include/asm-m68k/processor.h
include/asm-mips/a.out.h
include/asm-mips/processor.h
include/asm-parisc/a.out.h
include/asm-parisc/processor.h
include/asm-powerpc/a.out.h
include/asm-powerpc/processor.h
include/asm-s390/a.out.h
include/asm-s390/processor.h
include/asm-sh/a.out.h
include/asm-sh/processor_32.h
include/asm-sh/processor_64.h
include/asm-sparc/a.out.h
include/asm-sparc/processor.h
include/asm-sparc64/a.out.h
include/asm-sparc64/processor.h
include/asm-sparc64/user.h
include/asm-um/a.out.h
include/asm-um/processor-generic.h
include/asm-x86/a.out.h
include/asm-x86/processor.h
include/asm-xtensa/a.out.h
include/asm-xtensa/processor.h

index e43cf61..02ce847 100644 (file)
@@ -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__ */
index 425b7b6..94afe58 100644 (file)
  */
 #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.
  */
index d7165e8..79489fd 100644 (file)
@@ -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
index 1bbf161..bd8029e 100644 (file)
 #include <asm/ptrace.h>
 #include <asm/types.h>
 
+#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;
index 9f398ab..e46375a 100644 (file)
@@ -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 */
index 4212551..49a88f5 100644 (file)
 
 #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)
index d37a684..6c3d652 100644 (file)
@@ -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__ */
index c571e95..1033e5c 100644 (file)
@@ -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 {
index 919b34a..c82e9f9 100644 (file)
@@ -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
index 568da1d..cdc0c1d 100644 (file)
@@ -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.
  */
index aa5d227..ded780f 100644 (file)
@@ -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__ */
index 49fc886..69e8a34 100644 (file)
@@ -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
index 7293ac1..193dcfb 100644 (file)
@@ -29,7 +29,4 @@ struct exec {
 #define N_SYMSIZE(x)   0
 #define N_TXTOFF(x)    0
 
-#ifdef __KERNEL__
-#include <asm/ustack.h>
-#endif
 #endif /* _ASM_IA64_A_OUT_H */
index 6a1b5d4..ab150f5 100644 (file)
@@ -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 */
index 32755bf..1a997fc 100644 (file)
@@ -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.
  */
index 6fc86a2..3885fe4 100644 (file)
@@ -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__ */
index 4453ec3..1f61ef5 100644 (file)
@@ -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.
  */
index bf55a5b..cad8371 100644 (file)
@@ -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 */
index 36f42de..58cbac5 100644 (file)
@@ -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;
index 23e2c90..eb04e34 100644 (file)
@@ -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__ */
index 3bb06e8..3c9d348 100644 (file)
 #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__
 
 /*
index 5c5ea83..89cead6 100644 (file)
@@ -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 */
index 1f4765d..fd98ca9 100644 (file)
@@ -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;
index 46158dc..8d6bd9c 100644 (file)
@@ -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__ */
index dfec2d0..e878563 100644 (file)
@@ -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 {
index 685d0f6..1f93130 100644 (file)
@@ -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 */
index a7edaa1..df2d5b0 100644 (file)
@@ -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.
  */
index 99c22b1..eda4bef 100644 (file)
@@ -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.
  */
index 917e042..744cfe6 100644 (file)
@@ -87,13 +87,4 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
 
 #define N_RELOCATION_INFO_DECLARED 1
 
-#ifdef __KERNEL__
-
-#include <asm/page.h>
-
-#define STACK_TOP      (PAGE_OFFSET - PAGE_SIZE)
-#define STACK_TOP_MAX  STACK_TOP
-
-#endif /* __KERNEL__ */
-
 #endif /* __SPARC_A_OUT_H__ */
index 6fbb3f0..40b1e41 100644 (file)
  * 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;
 
index 902e07f..53c95bd 100644 (file)
@@ -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__) */
index 66dd2fa..48e7496 100644 (file)
 #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__
 
index fce4e85..02b1389 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef _SPARC64_USER_H
 #define _SPARC64_USER_H
 
-#include <asm/a.out.h>
+#include <linux/a.out.h>
 struct sunos_regs {
        unsigned int psr, pc, npc, y;
        unsigned int regs[15];
index f42ff14..754181e 100644 (file)
@@ -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
index b7d9a16..7a1624c 100644 (file)
@@ -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.
  */
index a62443e..4684f97 100644 (file)
@@ -17,14 +17,4 @@ struct exec
 #define N_DRSIZE(a)    ((a).a_drsize)
 #define N_SYMSIZE(a)   ((a).a_syms)
 
-#ifdef __KERNEL__
-# include <linux/thread_info.h>
-# 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 */
index ab4d0c2..149920d 100644 (file)
@@ -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) \
 }
index 05a2f67..fdf1370 100644 (file)
 #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;
index 35145bc..96408f4 100644 (file)
@@ -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