summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-06-30 15:33:41 +0000
committerpeter <peter@FreeBSD.org>1999-06-30 15:33:41 +0000
commita9c3f31bb0491224037a1ed7887f14c277021020 (patch)
treef9777c45536ff9ecf106091344d191a7bea0d671 /sys/kern/init_main.c
parentd49508a31321de096bc8049987226e2b5d102577 (diff)
downloadFreeBSD-src-a9c3f31bb0491224037a1ed7887f14c277021020.zip
FreeBSD-src-a9c3f31bb0491224037a1ed7887f14c277021020.tar.gz
Slight tweak to fork1() calling conventions. Add a third argument so
the caller can easily find the child proc struct. fork(), rfork() etc syscalls set p->p_retval[] themselves. Simplify the SYSINIT_KT() code and other kernel thread creators to not need to use pfind() to find the child based on the pid. While here, partly tidy up some of the fork1() code for RF_SIGSHARE etc.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index d7273764..f988887 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.121 1999/05/09 20:42:45 peter Exp $
+ * $Id: init_main.c,v 1.122 1999/05/11 10:08:10 jb Exp $
*/
#include "opt_devfs.h"
@@ -180,6 +180,7 @@ mi_startup(framep)
register struct sysinit **sipp; /* system initialization*/
register struct sysinit **xipp; /* interior loop of sort*/
register struct sysinit *save; /* bubble*/
+ struct proc *p2;
/*
* Copy the locore.s frame pointer for proc0, this is forked into
@@ -227,17 +228,15 @@ restart:
case SI_TYPE_KTHREAD:
/* kernel thread*/
- if (fork1(&proc0, RFMEM|RFFDG|RFPROC))
+ if (fork1(&proc0, RFMEM|RFFDG|RFPROC, &p2))
panic("fork kernel thread");
- cpu_set_fork_handler(pfind(proc0.p_retval[0]),
- (*sipp)->func, (*sipp)->udata);
+ cpu_set_fork_handler(p2, (*sipp)->func, (*sipp)->udata);
break;
case SI_TYPE_KPROCESS:
- if (fork1(&proc0, RFFDG|RFPROC))
+ if (fork1(&proc0, RFFDG|RFPROC, &p2))
panic("fork kernel process");
- cpu_set_fork_handler(pfind(proc0.p_retval[0]),
- (*sipp)->func, (*sipp)->udata);
+ cpu_set_fork_handler(p2, (*sipp)->func, (*sipp)->udata);
break;
default:
OpenPOWER on IntegriCloud