| 1288 | } |
| 1289 | |
| 1290 | static void |
| 1291 | dma_preread_safe(vm_offset_t va, vm_paddr_t pa, vm_size_t size) |
| 1292 | { |
| 1293 | /* |
| 1294 | * Write back any partial cachelines immediately before and |
| 1295 | * after the DMA region. We don't need to round the address |
| 1296 | * down to the nearest cacheline or specify the exact size, |
| 1297 | * as dcache_wb_poc() will do the rounding for us and works |
| 1298 | * at cacheline granularity. |
| 1299 | */ |
| 1300 | if (va & BUSDMA_DCACHE_MASK) |
| 1301 | dcache_wb_poc(va, pa, 1); |
| 1302 | if ((va + size) & BUSDMA_DCACHE_MASK) |
| 1303 | dcache_wb_poc(va + size, pa + size, 1); |
| 1304 | |
| 1305 | dcache_inv_poc_dma(va, pa, size); |
| 1306 | } |
| 1307 | |
| 1308 | static void |
| 1309 | dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op) |
no test coverage detected