ADM-XRC SDK 2.8.1 User Guide (Linux)
© Copyright 2001-2009 Alpha Data
Prototype
ADMXRC2_STATUS ADMXRC2_SyncDirectMaster( ADMXRC2_HANDLE Card, ADMXRC2_DMADESC DMADesc, unsigned long Offset, unsigned long Length, ADMXRC2_SYNCMODE Mode);
Arguments
Argument | Type | Purpose |
Card | In | Handle of card |
DMADesc | In | A DMA descriptor identifying a buffer |
Offset | In | Offset of region within buffer to sync |
Length | In | Region within buffer to sync |
Mode | In | The kind of synchronisation to perform |
Return value
Value | Meaning |
ADMXRC2_SUCCESS | The buffer region was successfully synchronized |
ADMXRC2_INVALID_HANDLE | Card was not valid |
ADMXRC2_INVALID_DMADESC | DMADesc was not a valid DMA descriptor |
ADMXRC2_INVALID_PARAMETER | Mode was not valid, or Offset and Length were out of bounds |
Description
The ADMXRC2_SyncDirectMaster function serves the purpose of ensuring that coherency is maintained in hardware-level buffers and caches, when the FPGA accesses host memory in direct master mode. Proper use of this function ensures that:
In practice, this means observing the following rules:
By the time ADMXRC2_SyncDirectMaster returns, modifications made to an application buffer will be visible to the FPGA, and vice-versa.
The Offset and Length parameters identify a region within the application buffer which DmaDesc refers to. This region should cover the parts of the user buffer which have been operated upon by the CPU or FPGA.
The Mode parameter should be one of members of the ADMXRC2_SYNCMODE enumerated type.
This function is not required by an application which uses only direct slave transfers (programmed I/O and DMA transfers via ADMXRC2_DoDMA and ADMXRC2_DoDMAImmediate). |