From 39f71a34bc0366e8195ad5bf0120b703930507ee Mon Sep 17 00:00:00 2001 From: he Date: Sat, 25 Oct 2008 22:12:33 +0000 Subject: [PATCH] Resurrect cpu_setfunc(), and make cpu_lwp_fork() use it. Restores buildable status for the acorn26 kernel. skrll@ reviewed and commented an earlier version of this diff. --- sys/arch/acorn26/acorn26/vm_machdep.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/arch/acorn26/acorn26/vm_machdep.c b/sys/arch/acorn26/acorn26/vm_machdep.c index d218d56a7af2..d6109b7fa106 100644 --- a/sys/arch/acorn26/acorn26/vm_machdep.c +++ b/sys/arch/acorn26/acorn26/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.19 2008/01/25 21:23:50 chris Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.20 2008/10/25 22:12:33 he Exp $ */ /*- * Copyright (c) 2000, 2001 Ben Harris @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.19 2008/01/25 21:23:50 chris Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.20 2008/10/25 22:12:33 he Exp $"); #include #include @@ -136,6 +136,17 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, l2->l_addr->u_pcb.pcb_tf = tf; /* Fabricate a new switchframe */ bzero(sf, sizeof(*sf)); + + cpu_setfunc(l2, func, arg); +} + +void +cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg) +{ + struct pcb *pcb = &l->l_addr->u_pcb; + struct trapframe *tf = pcb->pcb_tf; + struct switchframe *sf = (struct switchframe *)tf - 1; + sf->sf_r13 = (register_t)tf; /* Initial stack pointer */ sf->sf_pc = (register_t)lwp_trampoline | R15_MODE_SVC;