📄 headers.htm
字号:
<html><head><title>Summary Tables</title>
<meta name="ROBOTS" content="NOFOLLOW">
<meta name="DESCRIPTION" content="Writing Device Drivers Tutorial: DIGITAL UNIX Version 4.0B documentation set">
<meta name="AUTHOR" content="Copyright (c) Digital Equipment Corporation 1996. All Rights Reserved."></head>
<body>
<a name="SumryTables"></a>
<p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="headers_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="headers_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut26.html"><img src="headers_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<img src="headers_files/BLANK.GIF" border="0">
<a href="#ListofHeaderFiles"><img src="headers_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut28.html"><img src="headers_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="headers_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="headers_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h1>A Summary Tables</h1>
<p>
This appendix presents tables that summarize:
</p><ul>
<p></p><li>
Header files
<p></p></li><li>
Kernel interfaces
<p></p></li><li>
ioctl commands
<p></p></li><li>
Global variables
<p></p></li><li>
Data structures
<p></p></li><li>
Device driver interfaces
<p></p></li><li>
Bus configuration interfaces
</li></ul><p>
<a name="ListofHeaderFiles"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="headers_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="headers_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#SumryTables"><img src="headers_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<img src="headers_files/BLANK.GIF" border="0">
<a href="#Listofkernsupp_rtns"><img src="headers_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut28.html"><img src="headers_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="headers_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="headers_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h2>
A.1 List of Header Files
</h2>
<p>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut27.html#hdrfile_desc">Table A-1</a>
lists the header files related to device drivers, along with short
descriptions of their contents.
For convenience, the header files are listed in alphabetical order.
Note that device drivers should include header files that use
the relative pathname instead of the explicit pathname.
For example, although
<tt>buf.h</tt>
resides in
<tt>/usr/sys/include/sys/buf.h</tt>,
device drivers should include it as:
</p><p>
</p><pre><sys/buf.h>
</pre>
<p>
</p><p>
Not all of the header files reside in
<tt><sys></tt>.
The following include files reside in other directories:
</p><p>
</p><pre><kern/lock.h>
<machine/cpu.h>
<io/common/devdriver.h>
</pre>
<p>
Chapter 1
of
<cite>Writing Device Drivers: Reference</cite>
provides reference page descriptions of the header files listed in
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut27.html#hdrfile_desc">Table A-1</a>.
</p><p>
<br>
<a name="hdrfile_desc"></a>
</p><h3>
Table A-1: Summary Descriptions of Header Files
</h3>
<a name="nx_id_885"></a>
<table border="4" cellpadding="4">
<tbody><tr>
<td align="left" valign="top">
<strong>
Header File
</strong>
</td>
<td align="left" valign="top">
<strong>
Contents
</strong>
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/buf.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the
<tt>buf</tt>
structure.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/conf.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the
<tt>dsent</tt>
structure.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<machine/cpu.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures and constants related to the CPU.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<io/common/devdriver.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the structures, constants, and external interfaces that
device drivers and the autoconfiguration software use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<io/common/devdriver_loadable.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines constants and declares external functions associated with dynamically
configured drivers.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<io/common/devgetinfo.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines various data structures used by the
<tt>DEVGETINFO</tt>
<tt>ioctl</tt>
command.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<io/common/devio.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines common structures and definitions for device drivers and
<tt>ioctl</tt>
commands.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/disklabel.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures and macros that operate on Digital UNIX disk labels.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/errno.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the error codes that a device driver returns to a user process.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/fcntl.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines I/O mode flags that user programs supply to
<tt>open</tt>
and
<tt>fcntl</tt>
system calls.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/ioctl.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines commands for
<tt>ioctl</tt>
interfaces in different device drivers.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<io/common/iotypes.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines constants that 64-bit conversions use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/kernel.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines global variables that the kernel uses.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<kern/lock.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines simple and complex lock structures.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/malloc.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines kernel memory allocator-related information.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/map.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures associated with resource allocation maps.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/mman.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines constants associated with the
<tt>mmap</tt>
kernel interface.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/mode.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines constants that driver interfaces use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/mtio.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines commands and structures for magnetic tape operations.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/param.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines constants and interfaces that the kernel uses.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/poll.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines polling bit masks.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/proc.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the
<tt>proc</tt>
structure, which defines a user process.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<kern/sched_prim.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines scheduling interfaces.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/security.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures, constants, and data types that UNIX security software
uses.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/select.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines select-related data structures and interfaces.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/sysconfig.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines
<tt>cfgmgr</tt>
framework operation codes and data structures used in the device driver's
<tt>configure</tt>
interface.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/systm.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines generic kernel global variables.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<kern/task.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures that tasks use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<kern/thread.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines structures that kernel threads use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/time.h>
</tt></strong>
</td>
<td align="left" valign="top">
Contains structures and symbolic names that time-related interfaces use.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/types.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines system data types and major and minor device interfaces.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/uio.h>
</tt></strong>
</td>
<td align="left" valign="top">
Contains the definition of the
<tt>uio</tt>
structure.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/user.h>
</tt></strong>
</td>
<td align="left" valign="top">
Defines the
<tt>user</tt>
structure.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/vm.h>
</tt></strong>
</td>
<td align="left" valign="top">
Contains a sequence of include statements that includes all of the
virtual memory-related files.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
<sys/vmmac.h>
</tt></strong>
</td>
<td align="left" valign="top">
Contains definitions for byte conversions.
</td>
</tr>
</tbody></table><p>
<a name="Listofkernsupp_rtns"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="headers_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="headers_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#SumryTables"><img src="headers_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#ListofHeaderFiles"><img src="headers_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#ListofGlobalVars"><img src="headers_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut28.html"><img src="headers_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="headers_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="headers_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h2>
A.2 List of Kernel Support Interfaces
</h2>
<p>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut27.html#sumrykern_iortns">Table A-2</a>
lists the kernel interfaces that device drivers use.
Chapter 2
of
<cite>Writing Device Drivers: Reference</cite>
provides reference page descriptions of the kernel interfaces
listed in
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut27.html#sumrykern_iortns">Table A-2</a>.
</p><blockquote><p align="center"><font size="+1"><strong>Note</strong></font></p><p>
Device drivers use the following header files most frequently:
</p></blockquote>
<p>
</p><p>
</p><pre>#include <sys/types.h>
#include <sys/errno.h>
#include <io/common/devdriver.h>
#include <sys/uio.h>
#include <machine/cpu.h>
#include <sys/conf.h>
#include <sys/sysconfig.h>
</pre>
<p>
</p><p>
</p><p>
<a name="nx_id_886"></a>
<a name="sumrykern_iortns"></a>
</p><h3>
Table A-2: Summary Descriptions of Kernel Support Interfaces
</h3>
<table border="4" cellpadding="4">
<tbody><tr>
<td align="left" valign="top">
<strong>
Kernel Interface
</strong>
</td>
<td align="left" valign="top">
<strong>
Summary Description
</strong>
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
assert_wait_mesg
</tt></strong>
</td>
<td align="left" valign="top">
Asserts that the current kernel thread is about to block (sleep).
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
atoi
</tt></strong>
</td>
<td align="left" valign="top">
Converts an ASCII string to an integer.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
BADADDR
</tt></strong>
</td>
<td align="left" valign="top">
Probes the address during device autoconfiguration.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
bcmp
</tt></strong>
</td>
<td align="left" valign="top">
Compares two byte strings.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
bcopy
</tt></strong>
</td>
<td align="left" valign="top">
Copies a series of bytes with a specified limit.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
biodone
</tt></strong>
</td>
<td align="left" valign="top">
Indicates that block I/O is complete.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
blkclr
</tt></strong>
</td>
<td align="left" valign="top">
Zeros a block of memory.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
brelse
</tt></strong>
</td>
<td align="left" valign="top">
Deallocates a
<tt>buf</tt>
structure.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
btop
</tt></strong>
</td>
<td align="left" valign="top">
Converts bytes to number of pages.
</td>
</tr>
<tr>
<td align="left" valign="top">
<strong><tt>
BUF_LOCK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -