Commit Graph

11 Commits

Author SHA1 Message Date
thorpej
8fd9032b90 ANSI'ify. 2000-07-14 07:14:33 +00:00
thorpej
e03e9e8086 Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1().  In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
2000-05-28 05:48:59 +00:00
thorpej
9f95aebc81 __predict_false() fork1() failing. 2000-05-08 19:59:48 +00:00
thorpej
7b3258b6a7 Make the kthread API a bit more friendly to loadable kernel modules. 1999-07-06 21:44:09 +00:00
thorpej
c10a926030 Allow the caller to specify a stack for the child process. If NULL,
the child inherits the stack pointer from the parent (traditional
behavior).  Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).
1999-05-13 21:58:32 +00:00
thorpej
5d97669cfe Allow an alternate exit signal (i.e. not SIGCHLD) to be delivered to the
parent, specified at fork time.  Specify a new flag to wait4(2), WALTSIG,
to wait for processes which use an alternate exit signal.

This is required for clone(2).
1999-05-13 00:59:03 +00:00
thorpej
645d5bd5f6 Share everything with proc0. 1999-04-30 21:40:30 +00:00
gwr
9b055e8c43 minor nits -- replace vsprintf with vsnprinf 1999-04-12 00:24:17 +00:00
kleink
7d144777a3 #ifdef __STDC__ -> #if __STDC__ 1998-12-22 21:21:36 +00:00
thorpej
1d03badef0 Implement a way to queue kernel threads for creation after init,
pagedaemon, reaper, etc.  Caller provides a callback function and
argument which will be called to create the threads.
1998-11-14 00:08:49 +00:00
thorpej
a0fac8a7bc Move fork_kthread() to a new file, kern_kthread.c, and rename it to
kthread_create().  Implement kthread_exit() (causes a thrad to exit).
Set P_NOCLDWAIT on kernel threads, which will cause any of their children
to be reparented to init(8) (which is already prepared to wait out orphaned
processes).
1998-11-11 22:44:24 +00:00