Difference between revisions of "Unit DMA"
From Ultibo.org
| Line 190: | Line 190: | ||
<br /> | <br /> | ||
| + | '''DMA data functions''' | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMADataCount(Data:PDMAData):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return the total number of data blocks in the linked list</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMADataFlags(Data:PDMAData):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return the combined flags of the data blocks in the linked list</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMADataMaximum(Data:PDMAData):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return the size of the largest data block in the linked list</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | |||
| + | '''DMA buffer functions''' | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMABufferAllocate(DMA:PDMAHost; Size:LongWord):Pointer; inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a data buffer for a DMA request</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''DMA''' | ||
| + | | The DMA host that the request will be sent to | ||
| + | |- | ||
| + | ! '''Size''' | ||
| + | | The size of the data buffer to allocate | ||
| + | |- | ||
| + | ! '''Return''' | ||
| + | | The newly allocated buffer or nil on failure | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMABufferAllocateEx(DMA:PDMAHost; var Size:LongWord):Pointer;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a data buffer for a DMA request</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''DMA''' | ||
| + | | The DMA host that the request will be sent to | ||
| + | |- | ||
| + | ! '''Size''' | ||
| + | | The size of the data buffer to allocate (Updated on return to actual size) | ||
| + | |- | ||
| + | ! '''Return''' | ||
| + | | The newly allocated buffer or nil on failure | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | This differs from DMABufferAllocate in that it updates the size value to reflect the actual size of the buffer allocated which may be required for some uses | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMABufferValidate(DMA:PDMAHost; Buffer:Pointer; Size:LongWord):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Validate a data buffer for a DMA request against the DMA host requirements</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''DMA''' | ||
| + | | The DMA host that the request will be sent to | ||
| + | |- | ||
| + | ! '''Buffer''' | ||
| + | | The data buffer to validate | ||
| + | |- | ||
| + | ! '''Size''' | ||
| + | | The size of the data buffer | ||
| + | |- | ||
| + | ! '''Return''' | ||
| + | | ERROR_SUCCESS on success or another error code on failure (ERROR_NOT_COMPATIBLE if not compatible with host) | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | Does not check for cache coherency requirements (Shared, Non Cached) only alignment and size. Buffers used as the source of a DMA request do not neccessarily need to meet alignment and size requirements, however buffers used as a destintation must meet these requirements or the caller must take appropriate actions to prevent undesiraable side effects from cache invalidation. | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function DMABufferRelease(Buffer:Pointer):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a data buffer from a DMA request</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Data''' | ||
| + | | The buffer to be released | ||
| + | |- | ||
| + | ! '''Return''' | ||
| + | | ERROR_SUCCESS on success or another error code on failure | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] | ||
Revision as of 03:21, 28 July 2016
Return to Unit Reference
Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure DMAInit;
Description: To be documented
| Note | To be documented |
|---|
DMA host functions
function DMAHostStart(DMA:PDMAHost):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostStop(DMA:PDMAHost):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostReset(DMA:PDMAHost):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostProperties(DMA:PDMAHost; Properties:PDMAProperties):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostCreate:PDMAHost;
Description: Create a new DMA entry
| Return | Pointer to new DMA entry or nil if DMA could not be created |
|---|
function DMAHostCreateEx(Size:LongWord):PDMAHost;
Description: Create a new DMA entry
| Size | Size in bytes to allocate for new DMA (Including the DMA entry") |
|---|---|
| Return | Pointer to new DMA entry or nil if DMA could not be created |
function DMAHostDestroy(DMA:PDMAHost):LongWord;
Description: Destroy an existing DMA entry
| Note | To be documented |
|---|
function DMAHostRegister(DMA:PDMAHost):LongWord;
Description: Register a new DMA in the DMA host table
| Note | To be documented |
|---|
function DMAHostDeregister(DMA:PDMAHost):LongWord;
Description: Deregister a DMA from the DMA host table
| Note | To be documented |
|---|
function DMAHostFind(DMAId:LongWord):PDMAHost;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostEnumerate(Callback:TDMAEnumerate; Data:Pointer):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function DMAHostNotification(DMA:PDMAHost; Callback:TDMANotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
| Note | To be documented |
|---|
DMA data functions
function DMADataCount(Data:PDMAData):LongWord;
Description: Return the total number of data blocks in the linked list
| Note | To be documented |
|---|
function DMADataFlags(Data:PDMAData):LongWord;
Description: Return the combined flags of the data blocks in the linked list
| Note | To be documented |
|---|
function DMADataMaximum(Data:PDMAData):LongWord;
Description: Return the size of the largest data block in the linked list
| Note | To be documented |
|---|
DMA buffer functions
function DMABufferAllocate(DMA:PDMAHost; Size:LongWord):Pointer; inline;
Description: Allocate a data buffer for a DMA request
| DMA | The DMA host that the request will be sent to |
|---|---|
| Size | The size of the data buffer to allocate |
| Return | The newly allocated buffer or nil on failure |
function DMABufferAllocateEx(DMA:PDMAHost; var Size:LongWord):Pointer;
Description: Allocate a data buffer for a DMA request
| DMA | The DMA host that the request will be sent to |
|---|---|
| Size | The size of the data buffer to allocate (Updated on return to actual size) |
| Return | The newly allocated buffer or nil on failure |
| Note | This differs from DMABufferAllocate in that it updates the size value to reflect the actual size of the buffer allocated which may be required for some uses |
function DMABufferValidate(DMA:PDMAHost; Buffer:Pointer; Size:LongWord):LongWord;
Description: Validate a data buffer for a DMA request against the DMA host requirements
| DMA | The DMA host that the request will be sent to |
|---|---|
| Buffer | The data buffer to validate |
| Size | The size of the data buffer |
| Return | ERROR_SUCCESS on success or another error code on failure (ERROR_NOT_COMPATIBLE if not compatible with host) |
| Note | Does not check for cache coherency requirements (Shared, Non Cached) only alignment and size. Buffers used as the source of a DMA request do not neccessarily need to meet alignment and size requirements, however buffers used as a destintation must meet these requirements or the caller must take appropriate actions to prevent undesiraable side effects from cache invalidation. |
function DMABufferRelease(Buffer:Pointer):LongWord;
Description: Release a data buffer from a DMA request
| Data | The buffer to be released |
|---|---|
| Return | ERROR_SUCCESS on success or another error code on failure |
Return to Unit Reference