DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

bcb_prep(D3)


bcb_prep -- prepare a breakup control block structure for use

Synopsis

   #include <sys/types.h>
   #include <sys/buf.h>
   #include <sys/kmem.h>
   #include <sys/ddi.h>
   

boolean_t bcb_prep(bcb_t *bcbp, int flag);

Description

bcb_prep( ) prepares a bcb(D4) structure for use. The bcb structure is used to pass breakup property alignments to the buf_breakup(D3) function.

Arguments


bcbp
Pointer to a previously allocated bcb(D4) structure.

flag
Indicates whether the allocation may block or not, and is set to KM_SLEEP or KM_NOSLEEP.

Return values

On success, bcb_prep returns B_TRUE.

On failure, the routine returns B_FALSE, either due to allocation failure in the KM_NOSLEEP case or due to unsupportable constraints specified in bcbp.

Usage

bcb_prep( ) must be called after all necessary fields in the structure pointed to by bcbp have been set, but before the structure is passed to the buf_breakup(D3) function. It implicitly calls the physreq_prep(D3) function for the associated physreq(D4) structure.

bcb_prep( ) can be called multiple times on the same bcb structure.

If the driver modifies the fields of the bcbp after it has been prepped, then the driver must call bcb_prep again before actually using it.

Context and synchronization

If flag is set to KM_NOSLEEP, non-blockable, initialization, or interrupt context.

If flag is set to KM_SLEEP, user context.

Hardware applicability

All

Version applicability

ddi: 8, 8mp

Differences between versions

In DDI versions prior to version 8, use bcb(D4) structures without bcb_prep( ).

References

bcb(D4), bcb_alloc(D3), bcb_free(D3), buf_breakup(D3)

``DMA'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005