BSP and Device Driver Development Guide
This is a collection of routines that are invoked by the portable part of the Shared Memory Driver to manage locks in the shared memory buffer area. Accesses to the shared memory must be atomic. Two nodes in a multiprocessor system must not be manipulating the shared data structures simultaneously. The locking primitives are used to insure this.
To avoid deadlock, local processor interrupts should be disabled the entire time the locked queue is locked.
The locking primitives operate on the lock
field
of the Shm_Locked_queue_Control
data structure. This structure is defined as follows:
typedef struct { vol_u32 lock; /* lock field for this queue */ vol_u32 front; /* first envelope on queue */ vol_u32 rear; /* last envelope on queue */ vol_u32 owner; /* receiving (i.e. owning) node */ } Shm_Locked_queue_Control;
where each field is defined as follows:
BSP and Device Driver Development Guide
Copyright © 1988-2000 OAR Corporation