2 .\" Copyright (c) 2010, Venkatesh Srinivas <me@endeavour.zapto.org>
4 .\" Permission to use, copy, modify, or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .Dd September 29, 2010
21 .Nd Subsystem initialization
24 .Fn SYSINIT "uniquifier" "subsystem" "order" "func" "ident"
27 is a mechanism used in the initialization of kernel subsystems.
30 is called with the argument
32 either when the kernel is booted or when a module is loaded, depending on where
33 the invocation is found.
39 parameters control when the function is called during initialization.
41 calls all of the functions in a subsystem before advancing to the next one.
45 invocations will use one of these identifiers for
47 .Bl -tag -width ".Dv SI_SUB_HELPER_THREADS"
49 Device driver initialization
51 Virtual file system, vnodes, vnode recovery, namecache
52 .It Dv SI_SUB_HELPER_THREADS
53 Helper threads (used by random number generator)
54 .It DV SI_SUB_KTHREAD_VM
55 VM daemon initialization
56 .It Dv SI_SUB_KTHREAD_IDLE
57 Idle-time kernel threads
60 These subsystems are initialized in the order they are listed.
61 For the complete list of subsystems, consult
66 parameter controls when in a subsystem a function is called.
69 parameter marks a function to be called first in subsystem.
74 flags mark a function to be called second and third, respectively.
77 flag marks a function to be called somewhere in the middle of a
78 subsystem's initialization.
81 flag marks a function to be called after all other types of functions.
85 parameter is a unique identifier for this
89 This example calls the function
93 argument at any point while initializing helper threads:
95 SYSINIT(rand, SI_SUB_HELPER_THREADS, SI_ORDER_ANY, rand_thread_init, NULL);