没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle Solaris 9 - man pages section 9: DDI and DKI Properties and Data Structures
Oracle Solaris 9 - man pages section 9: DDI and DKI Properties a...
需积分: 5 0 下载量 143 浏览量
更新于2023-11-23
收藏 626KB PDF 举报
Oracle Solaris 9是由Sun Microsystems公司开发的一款操作系统。本文介绍了Oracle Solaris 9的man页面中的第9节,主要涉及DDI(Device Driver Interface)和DKI(Driver-Kernel Interface)的属性和数据结构。 这份文档所属的公司是Sun Microsystems公司,地址位于美国加利福尼亚州圣克拉拉网络圈4150号。该文档的编号为817-0703-10,发布日期为2003年12月。Sun Microsystems公司在此文档中声明了对该产品或文档的版权保护,并在许可证下限制其使用、复制、分发和反编译。未经Sun及其许可方的事先书面授权,不得以任何形式复制本产品或文档的任何部分。 此外,第三方软件(包括字体技术)的版权属于Sun供应商,并经过许可。产品的部分内容可能派生自加利福尼亚大学授权的Berkeley BSD系统。UNIX是一个注册商标。 总结来说,本文介绍了Oracle Solaris 9的man页面中关于DDI和DKI属性和数据结构的内容,并强调了对该产品或文档的版权保护。
资源详情
资源推荐
Structure Type
scsi_hba_tran Solaris DDI
scsi_inquiry Solaris DDI
scsi_pkt Solaris DDI
scsi_status Solaris DDI
uio DDI/DKI
Intro(9E)
Do not declare arrays of structures as the size of the structures can change between
releases. Rely only on the structure members listed in this chapter and not on unlisted
members or the position of a member in a structure.
Intro(9S)
SEE ALSO
NOTES
16 man pages section 9: DDI and DKI Properties and Data Structures • Last Revised 15 May 2001
Data Structures for Drivers
17
aio_req – asynchronous I/O request structure
#include <sys/uio.h>
#include <sys/aio_req.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
Solaris DDI specific (Solaris DDI)
An aio_req structure describes an asynchronous I/O request.
struct uio*aio_uio; /* uio structure describing the I/O request */
The aio_uio member is a pointer to a uio(9S) structure, describing the I/O transfer
request.
aread(9E), awrite(9E), aphysio(9F), uio(9S)
aio_req(9S)
NAME
SYNOPSIS
INTERFACE
LEVEL
DESCRIPTION
STRUCTURE
MEMBERS
SEE ALSO
18 man pages section 9: DDI and DKI Properties and Data Structures • Last Revised 28 Mar 1997
buf – block I/O data transfer structure
#include <sys/ddi.h>
#include <sys/sunddi.h>
Architecture independent level 1 (DDI/DKI)
The buf structure is the basic data structure for block I/O transfers. Each block I/O
transfer has an associated buffer header. The header contains all the buffer control and
status information. For drivers, the buffer header pointer is the sole argument to a
block driver strategy(9E) routine. Do not depend on the size of the buf structure
when writing a driver.
A buffer header can be linked in multiple lists simultaneously. Because of this, most of
the members in the buffer header cannot be changed by the driver, even when the
buffer header is in one of the driver’s work lists.
Buffer headers are also used by the system for unbuffered or physical I/O for block
drivers. In this case, the buffer describes a portion of user data space that is locked into
memory.
Block drivers often chain block requests so that overall throughput for the device is
maximized. The av_forw and the av_back members of the buf structure can serve
as link pointers for chaining block requests.
int b_flags; /* Buffer status */
struct buf *av_forw; /* Driver work list link */
struct buf *av_back; /* Driver work list link */
size_t b_bcount; /* # of bytes to transfer */
union {
caddr_t b_addr; /* Buffer’s virtual address */
} b_un;
daddr_t b_blkno; /* Block number on device */
diskaddr_t b_lblkno; /* Expanded block number on device */
size_t b_resid; /* # of bytes not transferred */
size_t b_bufsize; /* size of allocated buffer */
int (*b_iodone)(struct buf *); /* function called */
/* by biodone */
int b_error; /* expanded error field */
void *b_private; /* "opaque" driver private area */
dev_t b_edev; /* expanded dev field */
The members of the buffer header available to test or set by a driver are as follows:
b_flags stores the buffer status and indicates to the driver whether to read or write
to the device. The driver must never clear the b_flags member. If this is done,
unpredictable results can occur including loss of disk sanity and the possible failure of
other kernel processes.
All b_flags bit values not otherwise specified above are reserved by the kernel and
may not be used.
Valid flags are as follows:
buf(9S)
NAME
SYNOPSIS
INTERFACE
LEVEL
DESCRIPTION
STRUCTURE
MEMBERS
Data Structures for Drivers 19
B_BUSY Indicates the buffer is in use. The driver must not change this flag
unless it allocated the buffer with getrbuf(9F) and no I/O
operation is in progress.
B_DONE Indicates the data transfer has completed. This flag is read-only.
B_ERROR Indicates an I/O transfer error. It is set in conjunction with the
b_error field. bioerror(9F) should be used in preference to
setting the B_ERROR bit.
B_PAGEIO Indicates the buffer is being used in a paged I/O request. See the
description of the b_un.b_addr field for more information. This
flag is read-only.
B_PHYS indicates the buffer header is being used for physical (direct) I/O
to a user data area. See the description of the b_un.b_addr field
for more information. This flag is read-only.
B_READ Indicates that data is to be read from the peripheral device into
main memory.
B_WRITE Indicates that the data is to be transferred from main memory to
the peripheral device. B_WRITE is a pseudo flag and cannot be
directly tested; it is only detected as the NOT form of B_READ.
av_forw and av_back can be used by the driver to link the buffer into driver work
lists.
b_bcount specifies the number of bytes to be transferred in both a paged and a
non-paged I/O request.
b_un.b_addr is the virtual address of the I/O request, unless B_PAGEIO is set. The
address is a kernel virtual address, unless B_PHYS is set, in which case it is a user
virtual address. If B_PAGEIO is set, b_un.b_addr contains kernel private data. Note
that either one of B_PHYS and B_PAGEIO, or neither, can be set, but not both.
b_blkno identifies which logical block on the device (the device is defined by the
device number) is to be accessed. The driver might have to convert this logical block
number to a physical location such as a cylinder, track, and sector of a disk. This is a
32-bit value. The driver should use b_blkno or b_lblkno, but not both.
b_lblkno identifies which logical block on the device (the device is defined by the
device number) is to be accessed. The driver might have to convert this logical block
number to a physical location such as a cylinder, track, and sector of a disk. This is a
64-bit value. The driver should use b_lblkno or b_blkno, but not both.
b_resid should be set to the number of bytes not transferred because of an error.
b_bufsize contains the size of the allocated buffer.
b_iodone identifies a specific biodone routine to be called by the driver when the
I/O is complete.
buf(9S)
20 man pages section 9: DDI and DKI Properties and Data Structures • Last Revised 19 Sep 2002
剩余115页未读,继续阅读
weixin_40191861_zj
- 粉丝: 79
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 十种常见电感线圈电感量计算公式详解
- 军用车辆:CAN总线的集成与优势
- CAN总线在汽车智能换档系统中的作用与实现
- CAN总线数据超载问题及解决策略
- 汽车车身系统CAN总线设计与应用
- SAP企业需求深度剖析:财务会计与供应链的关键流程与改进策略
- CAN总线在发动机电控系统中的通信设计实践
- Spring与iBATIS整合:快速开发与比较分析
- CAN总线驱动的整车管理系统硬件设计详解
- CAN总线通讯智能节点设计与实现
- DSP实现电动汽车CAN总线通讯技术
- CAN协议网关设计:自动位速率检测与互连
- Xcode免证书调试iPad程序开发指南
- 分布式数据库查询优化算法探讨
- Win7安装VC++6.0完全指南:解决兼容性与Office冲突
- MFC实现学生信息管理系统:登录与数据库操作
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功