fix up cpu_setfunc() as noted by uwe:
- don't call lwp_startup for cpu_setfunc() users - introduce lwp_setfunc_trampoline instead - no need to set the "new" lwp for setfunc
This commit is contained in:
parent
850a493aca
commit
05c64062d1
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.h,v 1.85 2009/05/27 01:35:28 mrg Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.86 2009/05/29 22:06:55 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -196,6 +196,7 @@ int probeget(void *, int);
|
||||
void write_all_windows(void);
|
||||
void write_user_windows(void);
|
||||
void lwp_trampoline(void);
|
||||
void lwp_setfunc_trampoline(void);
|
||||
struct pcb;
|
||||
void snapshot(struct pcb *);
|
||||
struct frame *getfp(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: locore.s,v 1.245 2009/05/18 01:36:11 mrg Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.246 2009/05/29 22:06:55 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Paul Kranenburg
|
||||
@ -5043,6 +5043,9 @@ ENTRY(snapshot)
|
||||
*
|
||||
* If were setting up a kernel thread, the function *(%l0) will not
|
||||
* return.
|
||||
*
|
||||
* For KERN_SA applications, we provide an alternate entry point for
|
||||
* cpu_setfunc() to use.
|
||||
*/
|
||||
ENTRY(lwp_trampoline)
|
||||
/*
|
||||
@ -5055,6 +5058,7 @@ ENTRY(lwp_trampoline)
|
||||
call lwp_startup
|
||||
mov %l2, %o1
|
||||
|
||||
_ENTRY(lwp_setfunc_trampoline)
|
||||
call %l0
|
||||
mov %l1, %o0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vm_machdep.c,v 1.99 2009/05/27 04:08:06 mrg Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.100 2009/05/29 22:06:56 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -49,7 +49,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.99 2009/05/27 04:08:06 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.100 2009/05/29 22:06:56 mrg Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
|
||||
@ -275,8 +275,15 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2,
|
||||
|
||||
/* Construct kernel frame to return to in cpu_switch() */
|
||||
rp = (struct rwindow *)((u_int)npcb + TOPFRAMEOFF);
|
||||
/**rp = *(struct rwindow *)((u_int)opcb + TOPFRAMEOFF);*/
|
||||
rp->rw_local[0] = (int)func; /* Function to call */
|
||||
rp->rw_local[1] = (int)arg; /* and its argument */
|
||||
rp->rw_local[2] = (int)l2; /* new LWP */
|
||||
|
||||
cpu_setfunc(l2, func, arg);
|
||||
npcb->pcb_pc = (int)lwp_trampoline - 8;
|
||||
npcb->pcb_sp = (int)rp;
|
||||
npcb->pcb_psr &= ~PSR_CWP; /* Run in window #0 */
|
||||
npcb->pcb_wim = 1; /* Fence at window #1 */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -329,9 +336,8 @@ cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
|
||||
rp = (struct rwindow *)((u_int)pcb + TOPFRAMEOFF);
|
||||
rp->rw_local[0] = (int)func; /* Function to call */
|
||||
rp->rw_local[1] = (int)arg; /* and its argument */
|
||||
rp->rw_local[2] = (int)l; /* new lwp */
|
||||
|
||||
pcb->pcb_pc = (int)lwp_trampoline - 8;
|
||||
pcb->pcb_pc = (int)lwp_setfunc_trampoline - 8;
|
||||
pcb->pcb_sp = (int)rp;
|
||||
pcb->pcb_psr &= ~PSR_CWP; /* Run in window #0 */
|
||||
pcb->pcb_wim = 1; /* Fence at window #1 */
|
||||
|
Loading…
Reference in New Issue
Block a user