SVR5
bcb_alloc(D3)
bcb_alloc --
allocate a breakup control block
Synopsis
#include <sys/buf.h>
#include <sys/kmem.h>
#include <sys/ddi.h>
bcb_t *bcb_alloc(int flag);
Description
bcb_alloc allocates a
bcb(D4)
structure,
which is used to pass breakup property requirements
to
buf_breakup(D3).
Arguments
flag-
Indicates whether the allocation may sleep or not, and is
set to KM_SLEEP or KM_NOSLEEP.
Return values
On success, bcb_alloc returns a pointer to a
bcb structure.
If KM_NOSLEEP is specified and sufficient memory
is not immediately
available, bcb_alloc returns a NULL pointer.
Usage
bcb_alloc is typically called at driver startup time
to allocate a bcb structure for a driver or a drive.
This bcb is then used repeatedly,
for each transfer,
as an argument to the
buf_breakup( )
function.
The bcb structure is allocated
with all members set to 0.
Drivers written for DDI 8 and later versions
must call the
bcb_prep(D3)
function before calling
bcb_alloc( ).
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:
5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
Differences between versions
Drivers written for DDI versions prior to version 8
do not call the
bcb_prep(D3)
function before calling
bcb_alloc( ).
References
bcb(D4)
bcb_free(D3),
bcb_alloc(D3),
buf_breakup(D3)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005