summaryrefslogtreecommitdiff
path: root/sys/arch/mips
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/arch/mips
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/arch/mips')
-rw-r--r--sys/arch/mips/mips/vm_machdep.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/mips/mips/vm_machdep.c b/sys/arch/mips/mips/vm_machdep.c
index 642fc7c3cb6..8f8aaba4e5f 100644
--- a/sys/arch/mips/mips/vm_machdep.c
+++ b/sys/arch/mips/mips/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.5 1998/10/15 21:30:15 imp Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.6 1999/08/17 10:32:17 niklas Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -74,8 +74,10 @@ int vm_map_find_U __P((vm_map_t, vm_object_t, vm_offset_t, vm_offset_t *,
* the frame pointers on the stack after copying.
*/
int
-cpu_fork(p1, p2)
+cpu_fork(p1, p2, stack, stacksize)
register struct proc *p1, *p2;
+ void *stack;
+ size_t stacksize;
{
struct user *up = p2->p_addr;
pt_entry_t *pte;
@@ -113,6 +115,14 @@ cpu_fork(p1, p2)
/* cache segtab for ULTBMiss() */
p2->p_addr->u_pcb.pcb_segtab = (void *)p2->p_vmspace->vm_pmap.pm_segtab;
+#ifdef notyet
+ /*
+ * If specified, give the child a different stack.
+ */
+ if (stack != NULL)
+ /* XXX How??? */;
+#endif
+
/*
* Arrange for a non-local goto when the new process
* is started, to resume here, returning nonzero from setjmp.