In the MULTIPROCESSOR case, initialize p_cpu before a process is

marked SONPROC.
This commit is contained in:
thorpej 2000-05-31 05:10:54 +00:00
parent 8c2d00aaeb
commit 858becb7c2
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.17 2000/05/29 20:00:55 ragge Exp $
# $NetBSD: genassym.cf,v 1.18 2000/05/31 05:10:54 thorpej Exp $
#
# Copyright (c) 1997 Ludd, University of Lule}, Sweden.
# All rights reserved.
@ -52,6 +52,7 @@ define P_PRIORITY offsetof(struct proc, p_priority)
define P_ADDR offsetof(struct proc, p_addr)
define P_VMSPACE offsetof(struct proc, p_vmspace)
define P_STAT offsetof(struct proc, p_stat)
define P_CPU offsetof(struct proc, p_cpu)
define SONPROC SONPROC

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr.s,v 1.42 2000/05/29 20:00:55 ragge Exp $ */
/* $NetBSD: subr.s,v 1.43 2000/05/31 05:10:54 thorpej Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -279,8 +279,12 @@ noque: .asciz "swtch"
1: bneq 2f # more processes on queue?
bbsc r3,_sched_whichqs,2f # no, clear bit in whichqs
2: clrl 4(r2) # clear proc backpointer
movb $SONPROC,P_STAT(r2) # p->p_stat = SONPROC;
mfpr $PR_SSP,r1 # Get ptr to this cpu_info struct
/* p->p_cpu initialized in fork1() for single-processor */
#if defined(MULTIPROCESSOR)
movl r1,P_CPU(r2) # p->p_cpu = curcpu();
#endif
movb $SONPROC,P_STAT(r2) # p->p_stat = SONPROC;
movl r2,CI_CURPROC(r1) # set new process running
clrl CI_WANT_RESCHED(r1) # we are now changing process
cmpl r0,r2 # Same process?