macro declares a generic kernel module.
It is used to register the module with the system, using the
is usually used within other macros, such as
Of course, it can also be called directly, for example in
order to implement dynamic sysctls.
A module declared with
will load only if the running kernel version
(as specified by
is identical to that on which it was built.
This declaration should be used by modules which depend on interfaces beyond
the stable kernel KBI (such as ABI emulators or hypervisors that rely on
internal kernel structures).
will behave like
when compiled with modules built with the kernel. This allows locks and
other synchronization primitives to be inlined safely.
The arguments are:
The module name, which will be used in the
call to identify the module.
structure, which contains two main items, the official name of the
module name, which will be used in the
structure and a pointer to the event handler function of type
An argument directed to the
Valid values for this are contained in the
and specify the type of system startup interfaces.
macro uses a value of
here for example, since these modules contain a driver for a device.
For kernel modules that are loaded at runtime, a value of
An argument for
It represents the KLDs order of initialization within the subsystem.
Valid values are defined in the