PIO_BREAKUP(K) UNIX System V PIO_BREAKUP(K)
Name
pio_breakup - breaks up programmed I/O requests
Syntax
int
pio_breakup(xxstrategy, bp, maxsecsz)
int (*xxstrategy)();
struct buf *bp;
int maxsecsz;
Description
This routine breaks up programmed I/O requests into maxsecsz
pieces, and either reads data from the user process or
writes data to the user process depending on how b_flags
(pointed to by bp) is set. The address in the user process
from which data is read from or written to is pointed to by
the u.u_base field in the user structure. pio_breakup is
used to break up requests across page boundaries.
A buffer header is allocated and filled using information
from the bp buf pointer. Then the xxstrategy routine is
called. sleep(K) is called to wait until xxstrategy
completes.
If an error occurs, the error code is passed from b_error to
u.u_error, the allocated buffer is released, and pio_breakup
returns. In addition, the following fields are set in the
buffer header pointed to by bp:
+ b_resid - Set to the original value of b_count from the
passed in buffer header
+ b_flags - ORed with B_DONE and B_ERROR
+ b_error - Set to the value of u.u_error
Notes
pio_breakup calls spl0(K) which may alter previously set spl
levels in your driver.
This routine adjusts u.u_base, u.u_offset, and u.u_count
pio_breakup must not be called from an interrupt or xxinit
routine.
Parameters
xxstrategy The name of the xxstrategy routine for a
driver
bp Buffer header pointer
maxsecsz The maximum number of blocks to move in
each transfer. Typically, this value is
256, but it varies by device.
Return Value
None.
See Also
dma_breakup(K)
(printed 7/6/89)