DragonFly On-Line Manual Pages
SYSINIT(9) DragonFly Kernel Developer's Manual SYSINIT(9)
NAME
SYSINIT -- Subsystem initialization
SYNOPSIS
#include <sys/kernel.h>
SYSINIT(uniquifier, subsystem, order, func, ident);
DESCRIPTION
SYSINIT is a mechanism used in the initialization of kernel subsystems.
The function func is called with the argument ident either when the ker-
nel is booted or when a module is loaded, depending on where the invoca-
tion is found.
The subsystem and order parameters control when the function is called
during initialization. The kernel calls all of the functions in a sub-
system before advancing to the next one.
Most SYSINIT invocations will use one of these identifiers for subsystem:
SI_SUB_DRIVERS Device driver initialization
SI_SUB_VFS Virtual file system, vnodes, vnode recovery, name-
cache
SI_SUB_HELPER_THREADS Helper threads (used by random number generator)
DV SI_SUB_KTHREAD_VM VM daemon initialization
SI_SUB_KTHREAD_IDLE Idle-time kernel threads
These subsystems are initialized in the order they are listed. For the
complete list of subsystems, consult <sys/kernel.h>.
The order parameter controls when in a subsystem a function is called.
The SI_ORDER_FIRST parameter marks a function to be called first in sub-
system. The SI_ORDER_SECOND and SI_ORDER_THIRD flags mark a function to
be called second and third, respectively. The SI_ORDER_MIDDLE flag marks
a function to be called somewhere in the middle of a subsystem's initial-
ization. The SI_ORDER_ANY flag marks a function to be called after all
other types of functions.
The uniquifier parameter is a unique identifier for this SYSINIT invoca-
tion.
EXAMPLES
This example calls the function rand_thread_init() with a NULL argument
at any point while initializing helper threads:
SYSINIT(rand, SI_SUB_HELPER_THREADS, SI_ORDER_ANY, rand_thread_init, NULL);
DragonFly 3.5 September 29, 2010 DragonFly 3.5