MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_sync_icache

Function pmap_sync_icache

freebsd/arm64/arm64/pmap.c:6708–6736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6706}
6707
6708void
6709pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz)
6710{
6711
6712 PMAP_ASSERT_STAGE1(pmap);
6713 if (va >= VM_MIN_KERNEL_ADDRESS) {
6714 cpu_icache_sync_range(va, sz);
6715 } else {
6716 u_int len, offset;
6717 vm_paddr_t pa;
6718
6719 /* Find the length of data in this page to flush */
6720 offset = va & PAGE_MASK;
6721 len = imin(PAGE_SIZE - offset, sz);
6722
6723 while (sz != 0) {
6724 /* Extract the physical address & find it in the DMAP */
6725 pa = pmap_extract(pmap, va);
6726 if (pa != 0)
6727 cpu_icache_sync_range(PHYS_TO_DMAP(pa), len);
6728
6729 /* Move to the next page */
6730 sz -= len;
6731 va += len;
6732 /* Set the length for the next iteration */
6733 len = imin(PAGE_SIZE, sz);
6734 }
6735 }
6736}
6737
6738static int
6739pmap_stage2_fault(pmap_t pmap, uint64_t esr, uint64_t far)

Callers

nothing calls this directly

Calls 2

iminFunction · 0.85
pmap_extractFunction · 0.70

Tested by

no test coverage detected