summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.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/kern_linker.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/kern_linker.c')
-rw-r--r--sys/kern/kern_linker.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 61d7aeb..ce84271 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_linker.c,v 1.31 1999/04/28 01:04:28 luoqi Exp $
+ * $Id: kern_linker.c,v 1.32 1999/05/08 13:01:56 peter Exp $
*/
#include "opt_ddb.h"
@@ -96,6 +96,7 @@ linker_file_sysinit(linker_file_t lf)
struct sysinit** sipp;
struct sysinit** xipp;
struct sysinit* save;
+ struct proc *p2;
const moduledata_t *moddata;
int error;
@@ -156,18 +157,16 @@ linker_file_sysinit(linker_file_t lf)
case SI_TYPE_KTHREAD:
/* kernel thread*/
- if (fork1(&proc0, RFFDG|RFPROC|RFMEM))
+ if (fork1(&proc0, RFFDG|RFPROC|RFMEM, &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:
/* kernel thread*/
- 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