Memlock, Memunlock – Sundance SMT6035 v.2.2 User Manual

Page 37

Advertising
background image

Version 2.2

Page 37 of 39

SMT6035 User Manual


20.1 MemLock

Locks a memory buffer. This function can be used to lock a contiguous or
scatter-gather type buffer. In case of a scatter-gather type buffer, the user has
to allocate the memory before calling this function.

Prototype

Void * IFHw:: MemLock(

UINT nBytes, void *pBuf,

MDLEntry * pEntries, UINT &nEntCnt)

Parameters

nBytes

The size of the memory. For scatter-gather memory, this
specifies the size of the memory pointed by pBuf. For
contiguous memory, this specifies the required memory
size.

pBuf

For scatter gather memory, this points to the memory.
For contiguous memory, this needs to be zero.

pEntries

Optional pointer to a buffer that will receive the memory
descriptor list (MDL). When this value is zero, no MDL
list is returned.

nEntCnt

This is both an input and an output parameter. As an
input parameter, it indicates the number of MDL entries
that the pEntries buffer contains. When the function
returns, this variable contains the actual number of MDL
entries used to describe the memory locked.

Return value

This function returns a pointer to the locked memory, or zero on failure.
The function may fail if you are requesting the MDL list, but do not provide
enough storage for all the MDLs required to describe the locked memory.
In that case, nEntCnt will contain the number of MDL entries required to
describe the memory.

20.2 MemUnlock

Frees a contiguous region of memory that was previously allocated by a call to
MemLock().

Prototype

void IFHw::MemUnlock( void *pMem )

Parameters

pMem

Pointer to the memory to unlock.

User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.

Advertising