allocate a structure from the pool of structures
struct jpool * sdi_get(struct head *headp, int flag);
sdi_get allocates a structure from the available pool
If the pool is empty, an attempt
is made to allocate more kernel memory to satisfy
the current request.
If additional memory cannot be allocated and flag was
enabled, the routine will sleep.
pointer to the head structure of the pool
from which the memory piece was allocated
the flag which is used to decide whether
sdi_get can sleep if no
structures are currently available
Pointer to a jpool structure.
sdi_get is typically used in a local
Rather than having a local pool of job or
command structures, SDI
drivers should use one of the two existing
If the size
of structures in these pools are too small,
a new pool can be created
and used by the SDI driver.
There are two pools initialized
and used by existing SDI drivers.
They are struct head sm_poolhead (28
bytes per structure)
and struct head lg_poolhead (76 bytes per structure).
most of the HBA drivers use the small structures
for command blocks,
and the target drivers use the large
structures for job structures.
There are two rules for use of the
The third word (long/bytes 8
through 11) is reserved and must not be modified.
Once a structure
is freed, the driver cannot keep references to the
structure or reference the structure in any way.
If you need to bcopy another structure into
the structure allocated from sdi_get,
save the third word and
restore it after the copy.
In SVR4.2 MP, the sdi_get and
nothing more than call
The headp parameter is maintained simply to keep a
record of the allocation size.
Context and synchronization
If flag is set to KM_NOSLEEP,
non-blockable, initialization, or interrupt
If flag is set to KM_SLEEP,
x86/Pentium compatible architectures
1, 2, 3, 4
HBA and target drivers.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005