FreeBSD/sys/sparc64/sparc64/vm_machdep.c
/*
 * Intercept the return address from a freshly forked process that has NOT
 * been scheduled yet.
 *
 * This is needed to make kernel threads stay in kernel mode.
 */
Intercept the return address from a freshly forked process that has NOT
been scheduled yet.

This is needed to make kernel threads stay in kernel mode.
Intercept the return address from a freshly forked process that has NOT been scheduled yet . This is needed to make kernel threads stay in kernel mode .
void
cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg)
{
	struct frame *fp;
	struct pcb *pcb;
	pcb = td->td_pcb;
	fp = (struct frame *)(pcb->pcb_sp + SPOFF);
	fp->fr_local[0] = (u_long)func;
	fp->fr_local[1] = (u_long)arg;
}
void cpu_fork_kthread_handler ( struct thread * td , void ( * func ) ( void * ) , void * arg ) { struct frame * fp ; struct pcb * pcb ; pcb = td -> td_pcb ; fp = ( struct frame * ) ( pcb -> pcb_sp + SPOFF ) ; fp -> fr_local [ 0 ] = ( u_long ) func ; fp -> fr_local [ 1 ] = ( u_long ) arg ; }
Intercept the return address from a freshly forked process that has NOT
 been scheduled yet.
Intercept the return address from a freshly forked process that has NOT been scheduled yet .