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

Function smmu_map

freebsd/arm64/iommu/smmu.c:1636–1666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1634}
1635
1636static int
1637smmu_map(device_t dev, struct iommu_domain *iodom,
1638 vm_offset_t va, vm_page_t *ma, vm_size_t size,
1639 vm_prot_t prot)
1640{
1641 struct smmu_domain *domain;
1642 struct smmu_softc *sc;
1643 vm_paddr_t pa;
1644 int error;
1645 int i;
1646
1647 sc = device_get_softc(dev);
1648
1649 domain = (struct smmu_domain *)iodom;
1650
1651 dprintf("%s: %lx -> %lx, %ld, domain %d\n", __func__, va, pa, size,
1652 domain->asid);
1653
1654 for (i = 0; size > 0; size -= PAGE_SIZE) {
1655 pa = VM_PAGE_TO_PHYS(ma[i++]);
1656 error = pmap_senter(&domain->p, va, pa, prot, 0);
1657 if (error)
1658 return (error);
1659 smmu_tlbi_va(sc, va, domain->asid);
1660 va += PAGE_SIZE;
1661 }
1662
1663 smmu_sync(sc);
1664
1665 return (0);
1666}
1667
1668static struct iommu_domain *
1669smmu_domain_alloc(device_t dev, struct iommu_unit *iommu)

Callers

nothing calls this directly

Calls 4

device_get_softcFunction · 0.85
pmap_senterFunction · 0.85
smmu_tlbi_vaFunction · 0.85
smmu_syncFunction · 0.85

Tested by

no test coverage detected