Module interface:block - Block device interface
Block device interface. The CT.BLOCK channel-type provides a generic method for interacting with block devices (read and written in fixed-size sequentially addressed chunks). Many devices export a block interface as a method for aquiring device-specific channel interfaces (transported back over the device.io channel).
Index
-
Channel type
CT.BLOCK- Generic block device channel-type-
Variable
device.io!- Used for device-specific channel-end passing -
Variable
in?- Commands and data I/O -
Variable
out!- Responses and data I/O -
Variable
return?- Used to close an unshared block device connection (returns client-end)
-
Variable
-
Protocol
P.BLOCK.IN- Block device input protocol-
Tag
get.blocksize- Get bytes-per-block for device (API < 1.00) -
Tag
get.devicesize- Get device size in blocks (API < 1.00) -
Tag
ioctl- IO control (API < 1.00) -
Tag
read.block- Read a single block from the device (API < 1.00) -
Tag
read.blocks- Read blocks from the device (API >= 1.00) -
Tag
write.block- Write a single block to the device (API < 1.00) -
Tag
write.blocks- Write blocks to the device (API >= 1.00)
-
Tag
-
Protocol
P.BLOCK.OUT- Block device output protocol-
Tag
block- Response to read.block request (API < 1.00) -
Tag
blocks- Response to read.blocks request (API >= 1.00) -
Tag
blocksize- Response to get.blocksize request (API < 1.00) -
Tag
devicesize- Reponse to get.devicesize request (API < 1.00) -
Tag
result- Generic result ( ioctl , write )
-
Tag
Declarations
block_if.inc:36Protocol P.BLOCK.IN
PROTOCOL P.BLOCK.IN
Block device input protocol.
block_if.inc:39Tag get.blocksize
get.blocksize = 0
Get bytes-per-block for device (API < 1.00).
block_if.inc:41Tag get.devicesize
get.devicesize = 1
Get device size in blocks (API < 1.00).
block_if.inc:45Tag write.block
write.block = 2; INT64; MOBILE []BYTE
Write a single block to the device (API < 1.00).
Parameters:
INT64 |
bnum |
Block number. |
MOBILE []BYTE |
data |
Data to write (length must match block size). |
block_if.inc:48Tag read.block
read.block = 3; INT64
Read a single block from the device (API < 1.00).
Parameters:
INT64 |
bnum |
Block number. |
block_if.inc:51Tag ioctl
ioctl = 4; INT; INT
IO control (API < 1.00).
Parameters:
INT |
ictl, ival
|
IOCTL command and value. |
block_if.inc:56Tag write.blocks
write.blocks = 5; INT64; MOBILE []BYTE
Write blocks to the device (API >= 1.00).
Parameters:
INT64 |
sblk |
Starting block number. |
MOBILE []BYTE |
data |
Data to write (must be a multiple of the block size). |
block_if.inc:60Tag read.blocks
read.blocks = 6; INT64; INT64
Read blocks from the device (API >= 1.00).
Parameters:
INT64 |
sblk |
Starting block number. |
INT64 |
nblk |
Number of blocks to read. |
block_if.inc:63Protocol P.BLOCK.OUT
PROTOCOL P.BLOCK.OUT
Block device output protocol.
block_if.inc:66Tag blocksize
blocksize = 0; INT
Response to get.blocksize request (API < 1.00).
block_if.inc:68Tag devicesize
devicesize = 1; INT64
Reponse to get.devicesize request (API < 1.00).
block_if.inc:72Tag block
block = 2; INT64; MOBILE []BYTE
Response to read.block request (API < 1.00).
Parameters:
INT64 |
bnum |
Block number. |
MOBILE []BYTE |
data |
Data read from device. |
block_if.inc:75Tag result
result = 3; INT
Generic result (ioctl, write).
Parameters:
INT |
val |
Result value or error. |
block_if.inc:80Tag blocks
blocks = 4; INT64; INT64; MOBILE []BYTE
Response to read.blocks request (API >= 1.00).
Parameters:
INT64 |
sblk |
Starting block number. |
INT64 |
nblk |
Number of blocks read. |
MOBILE []BYTE |
data |
Data read from device. |
block_if.inc:83Channel type CT.BLOCK
RECURSIVE CHAN TYPE CT.BLOCK
Generic block device channel-type.
block_if.inc:86Variable in?
CHAN P.BLOCK.IN
Commands and data I/O.
block_if.inc:88Variable out!
CHAN P.BLOCK.OUT
Responses and data I/O.
block_if.inc:90Variable return?
CHAN CT.BLOCK!
Used to close an unshared block device connection (returns client-end).
block_if.inc:92Variable device.io!
CHAN MOBILE.CHAN
Used for device-specific channel-end passing.