PERFORCE change 124976 for review

Jesper Brix Rosenkilde jbr at FreeBSD.org
Thu Aug 9 13:10:46 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=124976

Change 124976 by jbr at 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 */


More information about the p4-projects mailing list