![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
DESCRIPTION
The
struct sysinit { enum sysinit_sub_id subsystem; /* subsystem identifier*/ enum sysinit_elem_order order; /* init order within subsystem*/ SLIST_ENTRY(sysinit) next; /* singly-linked list */ sysinit_cfunc_t func; /* function */ const void *udata; /* multiplexer/argument */ }; The
The
The startup linker set for the kernel is scanned during boot to build a sorted list of initialization routines. The initialization routines are then executed in the sorted order. The subsystem is used as the primary key and is sorted in ascending order. The order is used as the secondary key and is sorted in ascending order. The relative order of two routines that have the same subsystem and order is undefined. The startup linker sets for modules that are loaded together with
the kernel by the boot loader are scanned during the
The startup linker set for a kernel module loaded at runtime via kldload(2) is scanned, sorted, and executed when the module is loaded. The shutdown linker set for a kernel module is scanned, sorted, and executed when a kernel module is unloaded. The teardown routines are sorted in the reverse order of the initialization routines. The teardown routines of the kernel and any loaded modules are not executed during shutdown. EXAMPLESThis example shows the SYSINIT which displays the copyright notice during boot: static void print_caddr_t(void *data) { printf("%s", (char *)data); } SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright); SEE ALSOkld(4), DECLARE_MODULE(9), DEV_MODULE(9), DRIVER_MODULE(9), MTX_SYSINIT(9), SYSCALL_MODULE(9) HISTORYThe AUTHORSThe This manual page was written by Hiten Pandya <hmp@FreeBSD.org>.
|