DmaSync¶
Makes cached memory and a device agree before or after a transfer.
| Number | Selector | Blocking | Since |
|---|---|---|---|
0x0B SVC_MANAGEMEMORY |
MNGMEM_DMASYNC (6) |
no | 2.0 |
Err DmaSync(Handle dev, uintptr_t bus_addr, size_t len, DmaSyncOp op);
Registers: (dev, bus | op, len) -> r0 status
DMA_SYNC_FOR_DEVICE writes the CPU's cached data back before the device reads; DMA_SYNC_FOR_CPU discards stale cache lines before the CPU reads what the device wrote. Not needed for MEM_UNCACHED memory.
Parameters¶
| Name | Direction | Description |
|---|---|---|
dev |
in | Device handle with PERM_MAP. |
bus_addr |
in | Start of the range, inside one of the device's mappings. |
len |
in | Length in bytes. |
op |
in | DMA_SYNC_FOR_DEVICE or DMA_SYNC_FOR_CPU. |
Returns¶
ZUZU_OK, or an error code.
Errors¶
| Error | Condition |
|---|---|
ERR_NOENT |
The range is not inside a mapping of dev. |
ERR_BADARG |
Bad range or operation. |
ERR_BADHANDLE |
dev is not a live handle. |
ERR_BADTYPE |
dev is not a device. |
ERR_NOPERM |
dev lacks PERM_MAP. |