DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_driver_desc_alloc(D3sdi)


sdi_driver_desc_alloc -- allocate a layered SDI device structure

Synopsis

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

sdi_driver_desc_t *sdi_driver_desc_alloc(int flag);

Description

sdi_driver_desc_alloc( ) allocates an sdi_driver_desc(D4sdi) structure which is used by functions such as sdi_driver_add(D3sdi) to register drivers with SDI.

Arguments


flag
Set to KM_SLEEP or KM_NOSLEEP to indicate whether the allocation may block.

Return values

On success, sdi_driver_desc_alloc( ) returns a pointer to an sdi_driver_desc structure.

If KM_NOSLEEP is specified and sufficient memory is not immediately available, sdi_driver_desc_alloc( ) returns a NULL pointer.

Usage

sdi_driver_desc_alloc( ) is typically called at driver startup time to allocate a sdi_driver_desc(D4sdi) structure for registering the driver with SDI.

The sdi_driver_desc structure must be prepped with the sdi_driver_desc_prep(D3sdi) function before it is used.

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.

Driver-defined basic locks and read/write locks may be held across calls to this function if flag is KM_NOSLEEP, but may not be held if flag is KM_SLEEP.

Driver-defined sleep locks may be held across calls to this function regardless of the value of flag.

Hardware applicability

All

Version applicability

sdi: 4 layered drivers

References

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