The SYSINIT()
macro creates the
necessary SYSINIT data in SYSINIT's startup data set for
SYSINIT to sort and dispatch a function at system startup and
module load. SYSINIT()
takes a uniquifier
that SYSINIT uses to identify the particular function dispatch
data, the subsystem order, the subsystem element order, the
function to call, and the data to pass the function. All
functions must take a constant pointer argument.
SYSINIT()
Note that SI_SUB_FOO
and
SI_ORDER_FOO
need to be in the
sysinit_sub_id
and
sysinit_elem_order
enum's as mentioned
above. Either use existing ones or add your own to the
enum's. You can also use math for fine-tuning the order
a SYSINIT will run in. This example shows a SYSINIT that
needs to be run just barely before the SYSINIT's that
handle tuning kernel parameters.
SYSINIT()
OrderThe SYSUNINIT()
macro behaves similarly
to the SYSINIT()
macro except that it adds
the SYSINIT data to SYSINIT's shutdown data set.
SYSUNINIT()
This, and other documents, can be downloaded from http://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.