DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

lock_callback(D2hpci)


lock_callback -- lock hot plug callback structure

Synopsis

   #include <sys/types.h>
   #include <sys/hpci.h>
   #include <sys/ddi.h>
   

pl_t lock_callback(hpci_hpcd_t *hpcd_info);

void unlock_callback(hpci_hpcd_t *hpcd_info, pl_t old_ipl);

Description

lock_callback( ) locks the HPCD instance while the HPCD data structures are examined or modified by HPCI. unlock_callback( ) then releases the lock.

Arguments


hpcd_info
pointer to an hpci_hpcd_t(D4hpci) structure.

old_ipl
pl value returned by the corresponding call to lock_callback( ).

Return values

lock_callback( ) returns the pl(D5) priority level at which the routine was called. This value is used later by the unlock_callback( ) function.

unlock_callback( ) has no return value.

Usage

These routines are required in HPCD drivers. Code that examines or modifies the hpci_hpcd_t(D4hpci) structure is considered critical code that must execute atomically to preserve the integrity of the shared data structures. lock_callback( ) sets the lock, and unlock_callback( ) releases the lock. The relevent data structures are populated with these callback routines as part of hpci_attach() in CFG_ADD. See ``Critical code section'' in HDK Technical Reference.

Context and synchronization

Interrupt context

Hardware applicability

All

Version applicability

hpci: 1

References

hpci_attach(D3hpci), hpci_hpcd_t(D4hpci)

``Hotplug devices'' in HDK Technical Reference


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