VE DMA API functions for VEO.
More...
|
int | veo_dma_post (veo_proc_handle *phandle, uint64_t dst, uint64_t src, int size, ve_dma_handle_t *dhandle) |
| This function issues asynchronous DMA. More...
|
|
int | veo_dma_poll (veo_proc_handle *phandle, ve_dma_handle_t *dhandle) |
| This function inquiries the completion of asynchronous DMA. More...
|
|
int | veo_dma_post_wait (veo_proc_handle *phandle, uint64_t dst, uint64_t src, int size) |
| This function issues synchronous DMA. More...
|
|
uint64_t | veo_register_mem_to_dmaatb (void *vemva, size_t size) |
| This function registers VE local memory to DMAATB. More...
|
|
int | veo_unregister_mem_from_dmaatb (veo_proc_handle *h, uint64_t vehva) |
| This function unregisters VE local memory from DMAATB. More...
|
|
void | veo_access_pcircvsyc_register (veo_proc_handle *h) |
| access PCIRCVSYC register to synchronize the transferred data More...
|
|
VE DMA API functions for VEO.
This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program. To use VEO VE DMA API functions, include "ve_offload.h" header and "veo_vedma.h" header.
int veo_dma_post |
( |
veo_proc_handle * |
phandle, |
|
|
uint64_t |
dst, |
|
|
uint64_t |
src, |
|
|
int |
size, |
|
|
ve_dma_handle_t * |
dhandle |
|
) |
| |
This function issues asynchronous DMA.
- Note
- This function writes the DMA transfer request to the DMA descriptor table.
- Parameters
-
[in] | phandle | VEO process handle |
[in] | dst | 4 byte aligned VE host virtual address of destination |
[in] | src | 4 byte aligned VE host virtual address of source |
[in] | size | Transfer size which is a multiple of 4 and less than 128MB |
[out] | dhandle | Handle used to inquire DMA completion |
- Return values
-
0 | On success |
-EAGAIN | The DMA using the DMA descriptor to be used next is not yet completed
Need to call vedma_post() again. |
-ENOTSUP | Library load or symbol retrieval failed. |
-EBUSY | DMA start on VE or result wait failed. |
-EFAULT | dhandle is invalid. |
int veo_dma_poll |
( |
veo_proc_handle * |
phandle, |
|
|
ve_dma_handle_t * |
dhandle |
|
) |
| |
This function inquiries the completion of asynchronous DMA.
- Note
- This function inquiries the completion of DMA transfer request issued by vedma_post().
- Parameters
-
[in] | phandle | VEO process handle |
[in] | dhandle | DMA transfer request issued by vedma_post() |
- Return values
-
0 | DMA completed normally |
1-65535 | DMA failed
Exception value of DMA descriptor is returned.
DMA failed. The value is bitwise ORed combination of the values described below.
- 0x8000: Memory protection exception
- 0x4000: Missing page exception
- 0x2000: Missing space exception
- 0x1000: Memory access exception
- 0x0800: I/O access exception
|
-EAGAIN | DMA has not completed yet
Need to call vedma_poll() again |
-ENOTSUP | Library load or symbol retrieval failed. |
-EBUSY | DMA start on VE or result wait failed. |
-EFAULT | dhandle is invalid. |
int veo_dma_post_wait |
( |
veo_proc_handle * |
phandle, |
|
|
uint64_t |
dst, |
|
|
uint64_t |
src, |
|
|
int |
size |
|
) |
| |
This function issues synchronous DMA.
- Note
- This function writes the DMA transfer request to the DMA descriptor table, and waits for finish.
- Parameters
-
[in] | phandle | VEO process handle |
[in] | dst | 4 byte aligned VE host virtual address of destination |
[in] | src | 4 byte aligned VE host virtual address of source |
[in] | size | Transfer size which is a multiple of 4 and less than 128MB |
- Return values
-
0 | On success |
1-65535 | DMA failed
Exception value of DMA descriptor is returned.
DMA failed. The value is bitwise ORed combination of the values described below.
- 0x8000: Memory protection exception
- 0x4000: Missing page exception
- 0x2000: Missing space exception
- 0x1000: Memory access exception
- 0x0800: I/O access exception
|
-ENOTSUP | Library load or symbol retrieval failed. |
-EBUSY | DMA start on VE or result wait failed. |
uint64_t veo_register_mem_to_dmaatb |
( |
void * |
vemva, |
|
|
size_t |
size |
|
) |
| |
This function registers VE local memory to DMAATB.
- Note
- The default value of VE page size is 64MB.
In this case, values of vemva and size need to be aligned with 64MB boundary.
If VE page size is 2MB, values of vemva and size need to be aligned with 2MB boundary.
- Parameters
-
[in] | vemva | An address of memory to be registered
The address needs to be aligned with 64MB boundary. |
[in] | size | Size of memory aligned aligned with 64MB boundary |
- Return values
-
vehva | VE host virtual address on success |
0xffffffffffffffff | On failure (set errno)
- EINVAL Invalid argument.
- EFAULT Bad address.
- ESRCH No such process.
- ENOENT No such memory.
- EACCES Permission denied.
- ECANCEL Operation canceled.
- ENOTSUP Library load or symbol retrieval failed.
- EBUSY Starting memory registration to DMAATB or waiting for result of it failed.
|
int veo_unregister_mem_from_dmaatb |
( |
veo_proc_handle * |
h, |
|
|
uint64_t |
vehva |
|
) |
| |
This function unregisters VE local memory from DMAATB.
- Parameters
-
[in] | h | VEO process handle |
[in] | vehva | VE host virtual address of memory to be unregistered |
- Return values
-
0 | On success |
-1 | On failure (set errno)
- EINVAL Invalid argument.
- ECANCELED No such memory.
- ENOTSUP Library load or symbol retrieval failed.
- EBUSY Starting memory unregistration from DMAATB or waiting for result of it failed.
|
void veo_access_pcircvsyc_register |
( |
veo_proc_handle * |
h | ) |
|
access PCIRCVSYC register to synchronize the transferred data
PCIRCVSYC register is PCI receiver-side synchronization register which is accessed to wait the completion of inbound requests already received.
- Parameters
-