* Invalidate D-cache to PoC * * Caches are invalidated from outermost to innermost as fresh cachelines * flow in this direction. In given range, if there was no dirty cacheline * in any cache before, no stale cacheline should remain in them after this * operation finishes. */
| 532 | * operation finishes. |
| 533 | */ |
| 534 | static __inline void |
| 535 | dcache_inv_poc(vm_offset_t va, vm_paddr_t pa, vm_size_t size) |
| 536 | { |
| 537 | vm_offset_t eva = va + size; |
| 538 | |
| 539 | dsb(); |
| 540 | /* invalidate L2 first */ |
| 541 | cpu_l2cache_inv_range(pa, size); |
| 542 | |
| 543 | /* then L1 */ |
| 544 | va &= ~cpuinfo.dcache_line_mask; |
| 545 | for ( ; va < eva; va += cpuinfo.dcache_line_size) { |
| 546 | _CP15_DCIMVAC(va); |
| 547 | } |
| 548 | dsb(); |
| 549 | } |
| 550 | |
| 551 | /* |
| 552 | * Discard D-cache lines to PoC, prior to overwrite by DMA engine. |
no outgoing calls
no test coverage detected