Subject: Re: Review needed for change in vm_machdep.c
To: None <port-mips@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-mips
Date: 03/23/2000 19:28:53
On Thu, Mar 23, 2000 at 12:04:29PM -0800, Ethan Solomita wrote:

 > context switch. Although we're running at spl0, the pcb doesn't have a
 > saved value for the status register ST.

Heh, that's pretty cute :-)

 >         This way we'll get whatever the spl level is *now*, not at a
 > time of
 > context switch. It does fix the problem with splhigh kernel threads. But
 > I am not deeply familiar with the bowels of the mips port, so before I
 > change something like this I want to get other eyeballs on it.
 > 
 > 	Comments?

Yes!  :-)  Instead, proc0's PCB should be fully initialized.  I.e. the
value in its PCB should be the required value for "kernel mode, spl0"
when cpu_fork() is called.  What I would do instead is make sure that
proc0.p_addr->u_pcb.pcb_context[<ST>] is set to the appropriate value
before main() is called.

I think I'd do this by changing the call to mach_init() in locore.S
to call mips_init(), which in turn called mach_init(), and then
set the value appropriately before returning to locore code.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>