|
|
The notion of a min_pl assumes a defined order of priority levels. The following partial order is defined:
plbase < pltimeout <= pldisk,plstr <= plhi
The ordering of pldisk and plstr relative to each other is not defined.
Setting a given priority level will block interrupts associated with that level as well as any levels that are defined to be less than or equal to the specified level. In order to be portable a driver should not acquire locks at different priority levels where the relative order of those priority levels is not defined above.
The min_pl argument should specify a priority level that would be sufficient to block out any interrupt handler that might attempt to acquire this lock. In addition, potential deadlock problems involving multiple locks should be considered when defining the min_pl value. For example, if the normal order of acquisition of locks A and B (as defined by the lock hierarchy) is to acquire A first and then B, lock B should never be acquired at a priority level less than the min_pl for lock A. Therefore, the min_pl for lock B should be greater than or equal to the min_pl for lock A.
Note that the specification of min_pl with a LOCK_ALLOC(D3) or RW_ALLOC(D3) call does not actually cause any interrupts to be blocked upon lock acquisition. It simply asserts that subsequent LOCK calls to acquire this lock will pass in a priority level at least as great as min_pl.
``Synchronization primitives'' in HDK Technical Reference
``IPLs (Interrupt Priority Levels)'' in HDK Technical Reference