DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

pio_breakup(D3oddi)


pio_breakup -- break up programmed I/O requests

Synopsis

#include <sys/buf.h>

void pio_breakup(int (*xxstrategy)(), struct buf *bp, int maxsecsz);

Description

pio_breakup is used to break up programmed I/O requests across page boundaries.

Arguments


xxstrategy
Address of the driver's strategy(D2oddi) routine.

bp
Pointer to a buf structure.

maxsecsz
Maximum size of the pieces into which the I/O request is divided. Typically, maxsecsz is 256, but it varies by device.

Return values

None 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

b_flags
ORed with B_DONE and B_ERROR

b_error
set to the value of u.u_error

Usage

pio_breakup( ) breaks requests into maxsecsz pieces, and either reads data from the user process or writes data to the user process, depending on the setting of bp->b_flags. The u.u_base member of the user structure points to the address in the user process where data will be read or written.

A buffer header is allocated and filled, then the strategy(D2oddi) routine is called, using sleep(D3oddi) to wait until strategy( ) completes.

pio_breakup( ) calls spl0(D3oddi) which may alter previously set spl levels in your driver. pio_breakup( ) adjusts u.u_base, u.u_offset, and u.u_count.

Context and synchronization

User context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp

Differences between versions

For ODDI version 3 and forward, physio(D3oddi) handles this function internally so this call is not required.

SVR5 DDI compatibility

DDI drivers prior to version 8 call the buf_breakup(D3) function instead of pio_breakup( ) using the bcb(D4) structure to specify the constraints of the breakup.

Beginning with DDI version 8, buf_breakup( ) is called outside the driver, before the biostart(D2) entry point is called.

References

dma_breakup(D3oddi), strategy(D2oddi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005