a0SetLockDMARegion()

Sets a DMA region to be locked.


Syntax

a0tError a0SetLockDMARegion(
a0tLock *lock,
int index,
a0tDMARegion *region);

Arguments

Namerd/wrDescription
lock write Lock descriptor table to be set.
index read Index in the table.
region read DMA region to be locked.

Description

This function sets the DMA region region to be locked by the lock lock[index] in the next call to a0Lock() or a0ILock().

Lock descriptors are necessary when locking several regions together. The user must set a table of lock descriptors and pass all them to a lock function. The lock function will sort all the regions and lock all them in order. This helps to prevent deadlocks, as all locks are set in the same order.

On return of this function, the variable pointed by lock contains a lock descriptor for the given region.


Return Values

If an error condition occurs, it returns the error code, otherwise it returns A0ErrOk. Possible values are as follows:
Error CodeDescription
A0ErrOkSuccessful completion.

See Also

a0SetLockDMARegionPart() a0SetLockRead() a0SetUnlockWrite() a0Lock() a0Unlock()