📄 building dd.htm
字号:
<p>
This parameter maps to the
<tt><var>addrlimit</var></tt>
argument of the
<tt>contig_malloc</tt>
interface.
The parameter specifies
that the address of all the allocated memory should be less than or
equal to this address.
A zero (0) value means that there is no address limit requirement.
</p><p>
In the example, the address limit is
the value zero (0).
</p><p></p></li><li>
<tt>Type</tt>
<p>
This parameter maps to the
<tt><var>type</var></tt>
argument of the
<tt>contig_malloc</tt>
interface.
The parameter specifies
the purpose for which the memory is being allocated (or freed).
The memory type constants are defined in the file
<tt>/usr/sys/include/sys/malloc.h</tt>.
Examples of memory type constants are
<tt>M_DEVBUF</tt>
(device driver memory),
<tt>M_KTABLE</tt>
(kernel table memory),
<tt>M_RTABLE</tt>
(routing tables memory),
and so forth.
</p><p>
In the example, the type is
<tt>0x1f</tt>.
You should reference the
<tt>/usr/sys/include/sys/malloc.h</tt>
file to determine the hexadecimal value to be defined in the
<tt>Type</tt>
parameter.
</p><p></p></li><li>
<tt>Flag</tt>
<p>
This parameter maps to the
<tt><var>flag</var></tt>
argument of the
<tt>contig_malloc</tt>
interface.
The parameter specifies
one of the following flags defined in
<tt>/usr/sys/include/sys/malloc.h</tt>:
<table border="4" cellpadding="4">
<tbody><tr>
<td align="left" valign="top">
<strong>
Value
</strong>
</td>
<td align="left" valign="top">
<strong>
Meaning
</strong>
</td>
</tr>
<tr>
<td align="left" valign="top">
<tt>M_ZERO</tt>
</td>
<td align="left" valign="top">
Signifies that
<tt>contig_malloc</tt>
should zero the allocated memory.
</td>
</tr>
<tr>
<td align="left" valign="top">
<tt>M_WAITOK</tt>
</td>
<td align="left" valign="top">
Signifies that
<tt>contig_malloc</tt>
can block.
</td>
</tr>
<tr>
<td align="left" valign="top">
<tt>M_NOWAIT</tt>
</td>
<td align="left" valign="top">
Signifies that
<tt>contig_malloc</tt>
cannot block.
</td>
</tr>
</tbody></table></p><p>
</p><p>
In the example, the flag is the value
<tt>1</tt>.
You should reference the
<tt>/usr/sys/include/sys/malloc.h</tt>
file to determine the hexadecimal value to be defined in the
<tt>Flag</tt>
parameter.
</p></li></ul><p>
<a href="#co_id_97_rtn_1">[Return to example]</a>
</p></li></ol><p>
</p><p>
The example
<tt>sysconfigtab</tt>
file fragment discussed in this section uses a subset of the available
fields.
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut19.html#tblstanzaFieldsStaticDrv">Table 14-1</a>
describes all of the possible fields along with a short description.
</p><p>
<a name="tblstanzaFieldsStaticDrv"></a>
</p><h3>
Table 14-1: The sysconfigtab File Fragment Fields
</h3>
<a name="nx_id_602"></a>
<table border="4" cellpadding="4">
<tbody><tr>
<td align="left" valign="top">
<strong>
Field
</strong>
</td>
<td align="left" valign="top">
<strong>
Meaning
</strong>
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Dir
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Dir</tt>
field is optional.
It specifies a valid directory specification
for the location of the device
special files.
This directory is typically
<tt>/dev</tt>
for both block and character devices.
If you do not specify a directory for this field, it defaults to
<tt>/dev</tt>
for both block and character devices.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Subdir
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Subdir</tt>
field is optional.
It is appended to the directory specified or
defaulted to in the
<tt>Device_Dir</tt>
field.
The
<tt>Device_Subdir</tt>
field specifies a single directory location for the placement of the
device special files associated with both character and block drivers.
If you do not specify a directory for this field, the system places the
device special files in the directory specified or defaulted to in the
<tt>Device_Dir</tt>
field.
<p>
If the device special files for both block and character drivers
should not reside in a single directory,
use the
<tt>Device_Block_Subdir</tt>
and
<tt>Device_Char_Subdir</tt>
fields.
</p></td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Block_Subdir
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Block_Subdir</tt>
field is optional.
It specifies a subdirectory for the directory specified in
<tt>Device_Dir</tt>.
The
<tt>Device_Block_Subdir</tt>
field overrides any directory specification you made in the
<tt>Device_Subdir</tt>
field for device special files associated with block device drivers.
The system uses this directory to place the device special files for block
drivers to keep them separate from the device special
files for character drivers.
If you do not specify a directory for this field, the system places the
device special files in the directory specified or defaulted to in the
<tt>Device_Dir</tt>
field and the
<tt>Device_Subdir</tt>
field, if specified.
<p>
If the device special files for block device drivers reside in
the same directory as the device special files for character drivers,
use the
<tt>Device_Subdir</tt>
field.
</p></td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Char_Subdir
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Char_Subdir</tt>
field is optional.
It specifies a subdirectory for the directory specified in
<tt>Device_Dir</tt>.
The
<tt>Device_Char_Subdir</tt>
field overrides any directory specification you made in the
<tt>Device_Subdir</tt>
field for device special files associated with character device drivers.
The system uses this directory to place the device special files for character
drivers to keep them separate from the device special
files for block drivers.
If you do not specify a directory for this field, the system places the
device special files in the directory specified or defaulted to in the
<tt>Device_Dir</tt>
field and the
<tt>Device_Subdir</tt>
field, if specified.
<p>
If the device special files for character device drivers reside in
the same directory as the device special files for block drivers,
use the
<tt>Device_Subdir</tt>
field.
</p></td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Major_Req
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Major_Req</tt>
field is required.
It specifies the requirements that relate to
major number assignment.
Specify the value
<tt>Same</tt>.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Block_Major
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Block_Major</tt>
field is required only if the driver is a block device driver.
It specifies that the device special files associated with the
driver will be created and will be assigned a major number.
Specify the value
<tt>ANY</tt>.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Block_Minor
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Block_Minor</tt>
field is optional.
It specifies the minor numbers used to create the
device special files for the driver.
You must pair each minor number with a file name specified in the
<tt>Device_Block_Files</tt>
field.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Block_Files
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Block_Files</tt>
field is optional.
It specifies the device special files to be created.
You must pair each device special file name with a minor number
specified in the
<tt>Device_Block_Minor</tt>
field.
If a driver is both a block and character driver, specify device special
files in both the
<tt>Device_Block_Files</tt>
and
<tt>Device_Char_Files</tt>
fields.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Char_Major
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Char_Major</tt>
field is required only if the driver is a character driver.
It specifies that the device special files associated with the driver will
be created and will be assigned a major number.
Specify the value
<tt>ANY</tt>.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Char_Minor
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Char_Minor</tt>
field is optional.
It specifies the minor numbers used to create the
device special files for the driver.
You must pair each minor number with a file name specified in the
<tt>Device_Char_Files</tt>
field.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
Device_Char_Files
</tt></strong>
</td>
<td align="left" valign="top">
The
<tt>Device_Char_Files</tt>
field is optional.
It specifies the device special files to be created.
You must pair each device special file name with a minor number
specified in the
<tt>Device_Char_Minor</tt>
field.
If a driver is both a block and character driver, specify device special
files in both the
<tt>Device_Block_Files</tt>
and
<tt>Device_Char_Files</tt>
fields.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -