ADM-XRC SDK 2.8.1 User Guide (Linux)
© Copyright 2001-2009 Alpha Data
Prototype
ADMXRC_STATUS ADMXRC_SyncDirectMaster( ADMXRC_HANDLE Card, ADMXRC_DMADESC DMADesc, unsigned long Offset, unsigned long Length, DWORD Syncmode);
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 |
ADMXRC_SUCCESS | The buffer region was successfully synchronized |
ADMXRC_INVALID_HANDLE | Card was not valid |
ADMXRC_INVALID_DMADESC | DMADesc was not a valid DMA descriptor |
ADMXRC_INVALID_PARAMETER | Mode was not valid, or Offset and Length were out of bounds |
Description
The ADMXRC_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 ADMXRC_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 ADMXRC_SYNCMODE enumerated type.
This function is not required by an application which uses only direct slave transfers (programmed I/O and DMA transfers via ADMXRC_DoDMA and ADMXRC_DoDMAImmediate). |