a0SetLockDMARegionPart()

Sets a part of a DMA region to be locked.


Syntax

a0tError a0SetLockDMARegionPart(
a0tLock *lock,
int index,
a0tDMARegion *region,
int first,
int count);

Arguments

Namerd/wrDescription
lock write Lock descriptor table to be set.
index read Index in the table.
region read DMA region to be locked.
first read First element of the DMA region to lock.
count read Number of elements to lock.

Description

This function sets the the count elements of the DMA region region, starting at element first, 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

a0SetLockDMARegion() a0SetLockRead() a0SetUnlockWrite() a0Lock() a0Unlock()