3 kproc, pexit, postnote \- kernel process creation, termination and interruption
7 void kproc(char *name, void (*func)(void*), void *arg)
10 void pexit(char *note, int freemem)
13 int postnote(Proc *p, int dolock, char *n, int flag)
16 creates a new kernel process
27 structure of the new process; this value is the name of the kproc in
30 The process is made runnable; it
31 will run when selected by the scheduler
33 The process is created with base and current priorities set to
35 It shares the kernel process group and thus name space.
37 A kernel process terminates only when it calls
39 thereby terminating itself.
40 There is no mechanism for one process to force the termination of another,
41 although it can send a software interrupt using
44 is a null string on normal termination, or
49 any memory allocated by the process is discarded;
50 it should normally be non-zero for any process created
53 Use the following to terminate a kernel process normally:
60 sends a software interrupt to process
62 causing it, if necessary, to wake from
73 notes can be pending at once (currently 5);
74 if more than that arrive, the process is forced
80 but the message itself is discarded.
82 returns non-zero iff the note has been
83 delivered successfully.
88 synchronises delivery of the note with the debugger
89 and other operations of
92 is zero, or one of the following
95 Print the note message on the user's standard error.
96 Furthermore, suspend the process in a
98 state, preserving its memory, for later debugging.
101 Deliver the note quietly.
104 The note comes from another process, not the system.
108 to signal processes that commit grave faults,
109 and to implement the note and kill functions of
111 A device driver should use
113 only to tell a service process,
114 previously started by the driver using
117 the note will cause that process to raise an
119 For example, a process started to read packets from a network device could
120 be stopped as follows when the interface is unbound:
123 postnote(readp, 1, "unbind", 0);
128 points to the appropriate
130 The text of the message is typically irrelevant.
132 .B /sys/src/9/port/proc.c