diff options
Diffstat (limited to 'sys/arch/atari')
-rw-r--r-- | sys/arch/atari/atari/vm_machdep.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/atari/atari/vm_machdep.c b/sys/arch/atari/atari/vm_machdep.c index 8799926f17d..1eb03c4dd00 100644 --- a/sys/arch/atari/atari/vm_machdep.c +++ b/sys/arch/atari/atari/vm_machdep.c @@ -69,8 +69,10 @@ * the frame pointers on the stack after copying. */ void -cpu_fork(p1, p2) +cpu_fork(p1, p2, stack, stacksize) register struct proc *p1, *p2; + void *stack; + size_t stacksize; { register struct pcb *pcb = &p2->p_addr->u_pcb; register struct trapframe *tf; @@ -91,6 +93,13 @@ cpu_fork(p1, p2) tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1; p2->p_md.md_regs = (int *)tf; *tf = *(struct trapframe *)p1->p_md.md_regs; + + /* + * If specified, give the child a different stack. + */ + if (stack != NULL) + tf->tf_regs[15] = (u_int)stack + stacksize; + sf = (struct switchframe *)tf - 1; sf->sf_pc = (u_int)proc_trampoline; pcb->pcb_regs[6] = (int)child_return; /* A2 */ |