diff --git a/sys/arch/sh3/sh3/coff_exec.c b/sys/arch/sh3/sh3/coff_exec.c index fc424b678f04..1a53d9e657de 100644 --- a/sys/arch/sh3/sh3/coff_exec.c +++ b/sys/arch/sh3/sh3/coff_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: coff_exec.c,v 1.20 2003/07/15 03:35:56 lukem Exp $ */ +/* $NetBSD: coff_exec.c,v 1.21 2003/08/11 12:58:43 christos Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: coff_exec.c,v 1.20 2003/07/15 03:35:56 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coff_exec.c,v 1.21 2003/08/11 12:58:43 christos Exp $"); #include #include @@ -103,55 +103,6 @@ exec_coff_makecmds(struct proc *p, struct exec_package *epp) return error; } -/* - * exec_coff_setup_stack(): Set up the stack segment for a coff - * executable. - * - * Note that the ep_ssize parameter must be set to be the current stack - * limit; this is adjusted in the body of execve() to yield the - * appropriate stack segment usage once the argument length is - * calculated. - * - * This function returns an int for uniformity with other (future) formats' - * stack setup functions. They might have errors to return. - */ - -int -exec_coff_setup_stack(struct proc *p, struct exec_package *epp) -{ - DPRINTF(("enter exec_coff_setup_stack\n")); - - epp->ep_maxsaddr = USRSTACK - MAXSSIZ; - epp->ep_minsaddr = USRSTACK; - epp->ep_ssize = p->p_rlimit[RLIMIT_STACK].rlim_cur; - - /* - * set up commands for stack. note that this takes *two*, one to - * map the part of the stack which we can access, and one to map - * the part which we can't. - * - * arguably, it could be made into one, but that would require the - * addition of another mapping proc, which is unnecessary - * - * note that in memory, things assumed to be: 0 ....... ep_maxsaddr - * ep_minsaddr - */ - DPRINTF(("VMCMD: addr %lx size %lx\n", epp->ep_maxsaddr, - (epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr)); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, - ((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr), - epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE); - DPRINTF(("VMCMD: addr %lx size %lx\n", - epp->ep_minsaddr - epp->ep_ssize, - epp->ep_ssize)); - NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize, - (epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - - return 0; -} - - /* * exec_coff_prep_omagic(): Prepare a COFF OMAGIC binary's exec package */ @@ -188,7 +139,7 @@ exec_coff_prep_omagic(struct proc *p, struct exec_package *epp, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); #endif - return exec_coff_setup_stack(p, epp); + return (*epp->ep_esch->es_setup_stack)(p, epp); } /* @@ -227,7 +178,7 @@ exec_coff_prep_nmagic(p, epp, fp, ap) NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); - return exec_coff_setup_stack(p, epp); + return (*epp->ep_esch->es_setup_stack)(p, epp); } /* @@ -415,7 +366,7 @@ exec_coff_prep_zmagic(struct proc *p, struct exec_package *epp, epp->ep_daddr, epp->ep_dsize, epp->ep_entry)); #endif - return exec_coff_setup_stack(p, epp); + return (*epp->ep_esch->es_setup_stack)(p, epp); } #if 0