summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-17 10:32:20 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-17 10:32:20 +0000
commitd86a6c16672c6fd6de49e6c04095bbe180db8edf (patch)
treed4538cad037bcb5ad1572a3d144628a50e829859 /sys/uvm
parent63b7a98cc57e3a3fbf4e70bcd27a4eb65721c359 (diff)
New cpu_fork API to take a stack in which you point the child's stackpointer
to, at the bottom or the top, depending on your architecture's stack growth direction. This is in preparation for Linux' clone(2) emulation. port maintainers, please check that I did the work right.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_extern.h5
-rw-r--r--sys/uvm/uvm_glue.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h
index 1389cb1e221..a18c0ae1ec8 100644
--- a/sys/uvm/uvm_extern.h
+++ b/sys/uvm/uvm_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_extern.h,v 1.3 1999/07/23 14:47:06 ho Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.4 1999/08/17 10:32:19 niklas Exp $ */
/* $NetBSD: uvm_extern.h,v 1.21 1998/09/08 23:44:21 thorpej Exp $ */
/*
@@ -274,7 +274,8 @@ int uvm_fault __P((vm_map_t, vaddr_t,
#if defined(KGDB)
void uvm_chgkprot __P((caddr_t, size_t, int));
#endif
-void uvm_fork __P((struct proc *, struct proc *, boolean_t));
+void uvm_fork __P((struct proc *, struct proc *, boolean_t,
+ void *, size_t));
void uvm_exit __P((struct proc *));
void uvm_init_limits __P((struct proc *));
boolean_t uvm_kernacc __P((caddr_t, size_t, int));
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index dd27027eb32..dfbf67de7f6 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_glue.c,v 1.2 1999/02/26 05:32:06 art Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.3 1999/08/17 10:32:19 niklas Exp $ */
/* $NetBSD: uvm_glue.c,v 1.15 1998/10/19 22:21:19 tron Exp $ */
/*
@@ -266,9 +266,11 @@ uvm_vsunlock(p, addr, len)
* than just hang
*/
void
-uvm_fork(p1, p2, shared)
+uvm_fork(p1, p2, shared, stack, stacksize)
struct proc *p1, *p2;
boolean_t shared;
+ void *stack;
+ size_t stacksize;
{
struct user *up = p2->p_addr;
int rv;
@@ -304,12 +306,12 @@ uvm_fork(p1, p2, shared)
((caddr_t)&up->u_stats.pstat_endcopy -
(caddr_t)&up->u_stats.pstat_startcopy));
-/*
+ /*
* cpu_fork will copy and update the kernel stack and pcb, and make
* the child ready to run. The child will exit directly to user
* mode on its first time slice, and will not return here.
*/
- cpu_fork(p1, p2);
+ cpu_fork(p1, p2, stack, stacksize);
}
/*