diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-06 18:41:11 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-06 18:41:11 +0000 |
commit | 89ae7820c1a454d61cd281925d300bf324cfb4a3 (patch) | |
tree | 322119c116dc2ae1a396e832aac803b47d2df136 /sys/kern/init_main.c | |
parent | 1c0a1a534d87ced0c6089cb972b59491152bbdfa (diff) |
Let fork1, uvm_fork, and cpu_fork take a function/argument pair as argument,
instead of doing fork1, cpu_set_kpc. This lets us retire cpu_set_kpc and
avoid a multiprocessor race.
This commit breaks vax because it doesn't look like any other arch, someone
working on vax might want to look at this and try to adapt the code to be
more like the rest of the world.
Idea and uvm parts from NetBSD.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index fcb3083fa05..4d7f4265c74 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.80 2001/11/06 13:36:52 art Exp $ */ +/* $OpenBSD: init_main.c,v 1.81 2001/11/06 18:41:10 art Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -400,10 +400,8 @@ main(framep) p->p_rtime.tv_sec = p->p_rtime.tv_usec = 0; /* Create process 1 (init(8)). */ - if (fork1(p, SIGCHLD, FORK_FORK, NULL, 0, rval)) + if (fork1(p, SIGCHLD, FORK_FORK, NULL, 0, start_init, NULL, rval)) panic("fork init"); - initproc = pfind(rval[0]); - cpu_set_kpc(initproc, start_init, initproc); /* Create process 2, the pageout daemon kernel thread. */ if (kthread_create(uvm_pageout, NULL, NULL, "pagedaemon")) @@ -487,6 +485,8 @@ start_init(arg) char flags[4], *flagsp; char **pathp, *path, *ucp, **uap, *arg0, *arg1 = NULL; + initproc = p; + /* * Now in process 1. */ |