Fix errors reported by textproc/igor:
- wrap long line - use two spaces at sentence start - use tabs instead of spaces - space after content - straggling <tag> Event: vBSDcon FreeBSD Hackathon
This commit is contained in:
parent
de67b5b784
commit
24285bff3c
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=53372
1 changed files with 62 additions and 52 deletions
|
@ -4,15 +4,27 @@
|
|||
|
||||
$FreeBSD$
|
||||
-->
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="sysinit">
|
||||
<chapter xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
|
||||
xml:id="sysinit">
|
||||
<title>The SYSINIT Framework</title>
|
||||
|
||||
<indexterm><primary>SYSINIT</primary></indexterm>
|
||||
<indexterm><primary>dynamic initialization</primary></indexterm>
|
||||
<indexterm><primary>kernel initialization</primary>
|
||||
<secondary>dynamic</secondary></indexterm>
|
||||
<indexterm><primary>kernel modules</primary></indexterm>
|
||||
<indexterm><primary>kernel linker</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary>SYSINIT</primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>dynamic initialization</primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>kernel initialization</primary>
|
||||
<secondary>dynamic</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>kernel modules</primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>kernel linker</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>SYSINIT is the framework for a generic call sort and dispatch
|
||||
mechanism. FreeBSD currently uses it for the dynamic
|
||||
|
@ -35,8 +47,8 @@
|
|||
<term>Linker Set</term>
|
||||
<listitem>
|
||||
<para>A linker technique in which the linker gathers
|
||||
statically declared data throughout a program's source files
|
||||
into a single contiguously addressable unit of
|
||||
statically declared data throughout a program's source
|
||||
files into a single contiguously addressable unit of
|
||||
data.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -58,11 +70,12 @@
|
|||
|
||||
<para>SYSINIT uses two priorities when ordering the functions for
|
||||
execution. The first priority is a subsystem ID giving an
|
||||
overall order for SYSINIT's dispatch of functions. Current predeclared
|
||||
ID's are in <filename><sys/kernel.h></filename> in the enum
|
||||
list <literal>sysinit_sub_id</literal>. The second priority used
|
||||
is an element order within the subsystem. Current predeclared
|
||||
subsystem element orders are in
|
||||
overall order for SYSINIT's dispatch of functions. Current
|
||||
predeclared ID's are in
|
||||
<filename><sys/kernel.h></filename> in the enum
|
||||
list <literal>sysinit_sub_id</literal>. The second priority
|
||||
used is an element order within the subsystem. Current
|
||||
predeclared subsystem element orders are in
|
||||
<filename><sys/kernel.h></filename> in the enum list
|
||||
<literal>sysinit_elem_order</literal>.</para>
|
||||
|
||||
|
@ -77,11 +90,11 @@
|
|||
Device drivers should avoid using <literal>SYSINIT()</literal>
|
||||
directly. Instead drivers for real devices that are part of a
|
||||
bus structure should use <literal>DRIVER_MODULE()</literal> to
|
||||
provide a function that detects the device and, if it is present,
|
||||
initializes the device. It will do a few things specific to
|
||||
devices and then call <literal>SYSINIT()</literal> itself.
|
||||
For pseudo-devices, which are not part of a bus structure,
|
||||
use <literal>DEV_MODULE()</literal>.</para>
|
||||
provide a function that detects the device and, if it is
|
||||
present, initializes the device. It will do a few things
|
||||
specific to devices and then call <literal>SYSINIT()</literal>
|
||||
itself. For pseudo-devices, which are not part of a bus
|
||||
structure, use <literal>DEV_MODULE()</literal>.</para>
|
||||
</sect1>
|
||||
|
||||
|
||||
|
@ -115,8 +128,7 @@ SYSUNINIT(uniquifier, subsystem, order, func, ident)</programlisting>
|
|||
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.
|
||||
</para>
|
||||
functions must take a constant pointer argument.</para>
|
||||
|
||||
<example>
|
||||
<title>Example of a <literal>SYSINIT()</literal></title>
|
||||
|
@ -138,9 +150,7 @@ void foo_arg(void *vdata)
|
|||
struct foo *foo = (struct foo *)vdata;
|
||||
foo_data(foo);
|
||||
}
|
||||
SYSINIT(bar, SI_SUB_FOO, SI_ORDER_FOO, foo_arg, &foo_voodoo);
|
||||
</programlisting>
|
||||
</example>
|
||||
SYSINIT(bar, SI_SUB_FOO, SI_ORDER_FOO, foo_arg, &foo_voodoo);</programlisting></example>
|
||||
|
||||
<para>Note that <literal>SI_SUB_FOO</literal> and
|
||||
<literal>SI_ORDER_FOO</literal> need to be in the
|
||||
|
@ -153,7 +163,8 @@ SYSINIT(bar, SI_SUB_FOO, SI_ORDER_FOO, foo_arg, &foo_voodoo);
|
|||
handle tuning kernel parameters.</para>
|
||||
|
||||
<example>
|
||||
<title>Example of Adjusting <literal>SYSINIT()</literal> Order</title>
|
||||
<title>Example of Adjusting <literal>SYSINIT()</literal>
|
||||
Order</title>
|
||||
|
||||
<programlisting>static void
|
||||
mptable_register(void *dummy __unused)
|
||||
|
@ -192,8 +203,7 @@ struct foo_stack foo_stack = {
|
|||
void foo_flush(void *vdata)
|
||||
{
|
||||
}
|
||||
SYSUNINIT(barfoo, SI_SUB_FOO, SI_ORDER_FOO, foo_flush, &foo_stack);
|
||||
</programlisting>
|
||||
SYSUNINIT(barfoo, SI_SUB_FOO, SI_ORDER_FOO, foo_flush, &foo_stack);</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
|
Loading…
Reference in a new issue