Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Make uvmspace_exec() deal with procs that have no vm...
details: https://anonhg.NetBSD.org/src/rev/1ca84bd732ad
branches: trunk
changeset: 767796:1ca84bd732ad
user: martin <martin%NetBSD.org@localhost>
date: Sat Jul 30 20:05:46 2011 +0000
description:
Make uvmspace_exec() deal with procs that have no vmspace (yet) at all.
Greatly simplifies the upcoming posix_spawn implementation.
diffstat:
sys/uvm/uvm_map.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (44 lines):
diff -r c02bd00e3568 -r 1ca84bd732ad sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sat Jul 30 20:05:36 2011 +0000
+++ b/sys/uvm/uvm_map.c Sat Jul 30 20:05:46 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.301 2011/07/30 19:29:12 martin Exp $ */
+/* $NetBSD: uvm_map.c,v 1.302 2011/07/30 20:05:46 martin Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.301 2011/07/30 19:29:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.302 2011/07/30 20:05:46 martin Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -4184,13 +4184,24 @@
{
struct proc *p = l->l_proc;
struct vmspace *nvm, *ovm = p->p_vmspace;
- struct vm_map *map = &ovm->vm_map;
+ struct vm_map *map;
#ifdef __HAVE_CPU_VMSPACE_EXEC
cpu_vmspace_exec(l, start, end);
#endif
/*
+ * Special case: no vmspace yet (see posix_spawn) -
+ * no races possible in this case.
+ */
+ if (ovm == NULL) {
+ p->p_vmspace = uvmspace_alloc(start, end);
+ pmap_activate(l);
+ return;
+ }
+
+ map = &ovm->vm_map;
+ /*
* see if more than one process is using this vmspace...
*/
Home |
Main Index |
Thread Index |
Old Index