Subject: Re: more funky stuff with kthreads and interrupts
To: None <tech-kern@netbsd.org, nisimura@itc.aist-nara.ac.jp>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: tech-kern
Date: 05/09/2001 11:39:19
hubert.feyrer@informatik.fh-regensburg.de wrote;

>> /// FIX ///
>> Make sure to have spl0 condition whenever a new thread of control
>> is created.
>
> Would it make sense to check that in the the thread create function (I
> forgot what it's called)?

The direct cause of the error in this particular case is that pcb0 has
been overwritten while early system startup phase before the very
first kthread is created.  At the point processor runs spl0, but pcb0
contains splhigh value.

It'd be a solution to put savectx() just prior to memcpy of PCBs.
However, cpu_fork() has lost the tradional sense of "process forking"
in modern NetBSD.  It never returns twice anymore (It was the black
magic of UNIX). Instead, it prepares the newly created thread of
control to start to run at another control flow.  cpu_fork() is used
for dual purposes and it'd be rather better to change its name.

Tohru Nishimura