
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Remove the s390 version of setup_arg_pages32 function and use the generic
setup_arg_pages function instead.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 /dev/null                               |   92 --------------------------------
 25-akpm/arch/s390/kernel/Makefile       |    2 
 25-akpm/arch/s390/kernel/binfmt_elf32.c |    3 -
 3 files changed, 1 insertion(+), 96 deletions(-)

diff -puN arch/s390/kernel/binfmt_elf32.c~s390-remove-compat-setup_arg_pages32 arch/s390/kernel/binfmt_elf32.c
--- 25/arch/s390/kernel/binfmt_elf32.c~s390-remove-compat-setup_arg_pages32	2004-11-28 00:59:39.854214600 -0800
+++ 25-akpm/arch/s390/kernel/binfmt_elf32.c	2004-11-28 00:59:54.642966368 -0800
@@ -140,8 +140,6 @@ static inline int dump_task_fpu(struct t
 #include <linux/binfmts.h>
 #include <linux/compat.h>
 
-int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack);
-
 #define elf_prstatus elf_prstatus32
 struct elf_prstatus32
 {
@@ -191,7 +189,6 @@ struct elf_prpsinfo32
 
 #undef start_thread
 #define start_thread                    start_thread31 
-#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 -L arch/s390/kernel/compat_exec.c -puN arch/s390/kernel/compat_exec.c~s390-remove-compat-setup_arg_pages32 /dev/null
--- 25/arch/s390/kernel/compat_exec.c
+++ /dev/null	2003-09-15 06:40:47.000000000 -0700
@@ -1,92 +0,0 @@
-/*
- * Support for 32-bit Linux for S390 ELF binaries.
- *
- * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
- * Author(s): Gerhard Tonn (ton@de.ibm.com)
- *
- * Separated from binfmt_elf32.c to reduce exports for module enablement.
- *
- */
-
-#include <linux/config.h>
-#include <linux/slab.h>
-#include <linux/file.h>
-#include <linux/mman.h>
-#include <linux/a.out.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/smp_lock.h>
-#include <linux/init.h>
-#include <linux/pagemap.h>
-#include <linux/mm.h>
-#include <linux/highmem.h>
-#include <linux/spinlock.h>
-#include <linux/binfmts.h>
-#include <linux/module.h>
-#include <linux/security.h>
-
-#include <asm/uaccess.h>
-#include <asm/pgalloc.h>
-#include <asm/mmu_context.h>
-
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
-
-int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack)
-{
-	unsigned long stack_base;
-	struct vm_area_struct *mpnt;
-	struct mm_struct *mm = current->mm;
-	int i, ret;
-
-	stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
-	mm->arg_start = bprm->p + stack_base;
-
-	bprm->p += stack_base;
-	if (bprm->loader)
-		bprm->loader += stack_base;
-	bprm->exec += stack_base;
-
-	mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
-	if (!mpnt) 
-		return -ENOMEM; 
-	
-	if (security_vm_enough_memory((STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
-		kmem_cache_free(vm_area_cachep, mpnt);
-		return -ENOMEM;
-	}
-
-	memset(mpnt, 0, sizeof(*mpnt));
-
-	down_write(&mm->mmap_sem);
-	{
-		mpnt->vm_mm = mm;
-		mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
-		mpnt->vm_end = STACK_TOP;
-		/* executable stack setting would be applied here */
-		mpnt->vm_page_prot = PAGE_COPY;
-		mpnt->vm_flags = VM_STACK_FLAGS;
-		if ((ret = insert_vm_struct(mm, mpnt))) {
-			up_write(&mm->mmap_sem);
-			kmem_cache_free(vm_area_cachep, mpnt);
-			return ret;
-		}
-		mm->stack_vm = mm->total_vm = vma_pages(mpnt);
-	} 
-
-	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
-		struct page *page = bprm->page[i];
-		if (page) {
-			bprm->page[i] = NULL;
-			install_arg_page(mpnt, page, stack_base);
-		}
-		stack_base += PAGE_SIZE;
-	}
-	up_write(&mm->mmap_sem);
-	
-	return 0;
-}
-
-EXPORT_SYMBOL(setup_arg_pages32);
diff -puN arch/s390/kernel/Makefile~s390-remove-compat-setup_arg_pages32 arch/s390/kernel/Makefile
--- 25/arch/s390/kernel/Makefile~s390-remove-compat-setup_arg_pages32	2004-11-28 00:59:39.857214144 -0800
+++ 25-akpm/arch/s390/kernel/Makefile	2004-11-28 00:59:39.863213232 -0800
@@ -17,7 +17,7 @@ obj-$(CONFIG_SMP)		+= smp.o
 
 obj-$(CONFIG_S390_SUPPORT)	+= compat_linux.o compat_signal.o \
 					compat_ioctl.o compat_wrapper.o \
-					compat_exec.o compat_exec_domain.o
+					compat_exec_domain.o
 obj-$(CONFIG_BINFMT_ELF32)	+= binfmt_elf32.o
 
 obj-$(CONFIG_ARCH_S390_31)	+= entry.o reipl.o
_
