From owner-p4-projects@FreeBSD.ORG Thu Aug 9 20:10:46 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 51A5E16A41A; Thu, 9 Aug 2007 20:10:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00E316A418 for ; Thu, 9 Aug 2007 20:10:45 +0000 (UTC) (envelope-from jbr@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8A48A13C459 for ; Thu, 9 Aug 2007 20:10:45 +0000 (UTC) (envelope-from jbr@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l79KAjST091716 for ; Thu, 9 Aug 2007 20:10:45 GMT (envelope-from jbr@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l79KAjvm091712 for perforce@freebsd.org; Thu, 9 Aug 2007 20:10:45 GMT (envelope-from jbr@FreeBSD.org) Date: Thu, 9 Aug 2007 20:10:45 GMT Message-Id: <200708092010.l79KAjvm091712@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jbr@FreeBSD.org using -f From: Jesper Brix Rosenkilde To: Perforce Change Reviews Cc: Subject: PERFORCE change 124976 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2007 20:10:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=124976 Change 124976 by jbr@jbr_bob on 2007/08/09 20:10:36 Prepering for sf_buf, still needs unmap Affected files ... .. //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#10 edit .. //depot/projects/soc2007/jbr-syscall/src/sys/sys/exec.h#3 edit .. //depot/projects/soc2007/jbr-syscall/src/sys/sys/imgact.h#2 edit Differences ... ==== //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#10 (text+ko) ==== @@ -445,7 +445,8 @@ goto exec_fail_dealloc; } - exec_map_sysshm(imgp); + if (exec_map_sysshm(imgp)) + goto exec_fail_dealloc; /* * Special interpreter operation, cleanup and loop up to try to @@ -453,6 +454,7 @@ */ if (imgp->interpreted) { exec_unmap_first_page(imgp); + exec_unmap_sysshm(imgp); /* * VV_TEXT needs to be unset for scripts. There is a short * period before we determine that something is a script where @@ -787,6 +789,9 @@ if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); + if (imgp->sysshm != NULL) + exec_unmap_sysshm(imgp); + if (imgp->vp != NULL) { NDFREE(ndp, NDF_ONLY_PNBUF); vput(imgp->vp); @@ -906,14 +911,25 @@ int exec_map_sysshm(imgp) - struct image_params *imgp; + struct image_params *imgp; { + int error; vm_map_t map = &imgp->proc->p_vmspace->vm_map; vm_offset_t *addr = &imgp->proc->p_sysent->sv_sysshm; - vm_map_sysshm(map, addr, 42); + if (imgp->sysshm != NULL) + exec_unmap_sysshm(imgp); + + error = vm_map_sysshm(map, addr, 42); + + return(error); +} + +void +exec_unmap_sysshm(imgp) + struct image_params *imgp; +{ - return(0); } /* ==== //depot/projects/soc2007/jbr-syscall/src/sys/sys/exec.h#3 (text+ko) ==== @@ -75,6 +75,7 @@ void exec_unmap_first_page(struct image_params *); int exec_map_sysshm(struct image_params *); +void exec_unmap_sysshm(struct image_params *); int exec_register(const struct execsw *); int exec_unregister(const struct execsw *); ==== //depot/projects/soc2007/jbr-syscall/src/sys/sys/imgact.h#2 (text+ko) ==== @@ -60,6 +60,7 @@ char *interpreter_name; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ struct sf_buf *firstpage; /* first page that we mapped */ + struct sf_buf *sysshm; unsigned long ps_strings; /* PS_STRINGS for BSD/OS binaries */ size_t auxarg_size; struct image_args *args; /* system call arguments */