
From: David Howells <dhowells@redhat.com>

The attached patch fixes the usage of setup_arg_pages() in the IA64, MIPS,
S390 and Sparc64 arches.  This function now takes an extra parameter: the
initial top of stack.  This is useful in uClinux when there's no fixed
location to which the stack pointer can be initialised.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ia64/ia32/binfmt_elf32.c       |    2 +-
 25-akpm/arch/mips/kernel/irixelf.c          |    2 +-
 25-akpm/arch/s390/kernel/binfmt_elf32.c     |    2 +-
 25-akpm/arch/sparc64/kernel/binfmt_aout32.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff -puN arch/ia64/ia32/binfmt_elf32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes arch/ia64/ia32/binfmt_elf32.c
--- 25/arch/ia64/ia32/binfmt_elf32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes	2004-11-30 01:22:55.281484432 -0800
+++ 25-akpm/arch/ia64/ia32/binfmt_elf32.c	2004-11-30 01:22:55.290483064 -0800
@@ -35,7 +35,7 @@ extern void ia64_elf32_init (struct pt_r
 
 static void elf32_set_personality (void);
 
-#define setup_arg_pages(bprm,exec)		ia32_setup_arg_pages(bprm,exec)
+#define setup_arg_pages(bprm,tos,exec)		ia32_setup_arg_pages(bprm,exec)
 #define elf_map				elf32_map
 
 #undef SET_PERSONALITY
diff -puN arch/mips/kernel/irixelf.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes arch/mips/kernel/irixelf.c
--- 25/arch/mips/kernel/irixelf.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes	2004-11-30 01:22:55.283484128 -0800
+++ 25-akpm/arch/mips/kernel/irixelf.c	2004-11-30 01:22:55.291482912 -0800
@@ -685,7 +685,7 @@ static int load_irix_binary(struct linux
 	 * change some of these later.
 	 */
 	current->mm->rss = 0;
-	setup_arg_pages(bprm, EXSTACK_DEFAULT);
+	setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
 	current->mm->start_stack = bprm->p;
 
 	/* At this point, we assume that the image should be loaded at
diff -puN arch/s390/kernel/binfmt_elf32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes arch/s390/kernel/binfmt_elf32.c
--- 25/arch/s390/kernel/binfmt_elf32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes	2004-11-30 01:22:55.285483824 -0800
+++ 25-akpm/arch/s390/kernel/binfmt_elf32.c	2004-11-30 01:22:55.291482912 -0800
@@ -191,7 +191,7 @@ struct elf_prpsinfo32
 
 #undef start_thread
 #define start_thread                    start_thread31 
-#define setup_arg_pages(bprm, exec)     setup_arg_pages32(bprm, exec)
+#define setup_arg_pages(bprm, tos, exec)  setup_arg_pages32(bprm, exec)
 
 MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit Linux for S390 binaries,"
                    " Copyright 2000 IBM Corporation"); 
diff -puN arch/sparc64/kernel/binfmt_aout32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes arch/sparc64/kernel/binfmt_aout32.c
--- 25/arch/sparc64/kernel/binfmt_aout32.c~frv-change-setup_arg_pages-to-take-stack-pointer-fixes	2004-11-30 01:22:55.286483672 -0800
+++ 25-akpm/arch/sparc64/kernel/binfmt_aout32.c	2004-11-30 01:22:55.292482760 -0800
@@ -311,7 +311,7 @@ beyond_if:
 	orig_thr_flags = current_thread_info()->flags;
 	current_thread_info()->flags |= _TIF_32BIT;
 
-	retval = setup_arg_pages(bprm, EXSTACK_DEFAULT);
+	retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
 	if (retval < 0) { 
 		current_thread_info()->flags = orig_thr_flags;
 
_
