Lines Matching defs:pgtable

421 	pgtable_t *pgtable;
428 pgtable = (pgtable_t *)buf;
438 dmafp, NULL, &pgtable->hwpg_dmahdl) != DDI_SUCCESS) {
447 if (ddi_dma_mem_alloc(pgtable->hwpg_dmahdl, IMMU_PAGESIZE,
450 &pgtable->hwpg_memhdl) != DDI_SUCCESS) {
451 ddi_dma_free_handle(&pgtable->hwpg_dmahdl);
461 ddi_dma_mem_free(&pgtable->hwpg_memhdl);
462 ddi_dma_free_handle(&pgtable->hwpg_dmahdl);
467 pgtable->hwpg_paddr = pfn_to_pa(hat_getpfnum(kas.a_hat, vaddr));
468 pgtable->hwpg_vaddr = vaddr;
469 pgtable->swpg_next_array = next;
471 rw_init(&(pgtable->swpg_rwlock), NULL, RW_DEFAULT, NULL);
480 pgtable_t *pgtable;
482 pgtable = (pgtable_t *)buf;
485 rw_destroy(&(pgtable->swpg_rwlock));
487 ddi_dma_mem_free(&pgtable->hwpg_memhdl);
488 ddi_dma_free_handle(&pgtable->hwpg_dmahdl);
489 kmem_free(pgtable->swpg_next_array, IMMU_PAGESIZE);
494 * alloc a IOMMU pgtable structure.
501 * (for example to hold pointers to the next level pgtable).
507 pgtable_t *pgtable;
512 pgtable = kmem_cache_alloc(immu->immu_pgtable_cache, kmflags);
513 if (pgtable == NULL) {
516 return (pgtable);
520 pgtable_zero(pgtable_t *pgtable)
522 bzero(pgtable->hwpg_vaddr, IMMU_PAGESIZE);
523 bzero(pgtable->swpg_next_array, IMMU_PAGESIZE);
527 pgtable_free(immu_t *immu, pgtable_t *pgtable)
529 kmem_cache_free(immu->immu_pgtable_cache, pgtable);
1366 "pgtable for domain (%d). IOMMU unit: %s",
1779 * PFN (for PTE) or next level pgtable-paddr (for PDE) must be set
1851 pgtable_t *pgtable;
1856 pgtable = xlate->xlt_pgtable;
1867 shwp = (hw_pdte_t *)(pgtable->hwpg_vaddr) + idx;
1910 pgtable_t *pgtable;
1914 /* start with highest level pgtable i.e. root */
1923 pgtable = xlate->xlt_pgtable;
1929 /* Lock the pgtable in read mode */
1930 rw_enter(&(pgtable->swpg_rwlock), RW_READER);
1933 * since we are unmapping, the pgtable should
1934 * already point to a leafier pgtable.
1936 next = *(pgtable->swpg_next_array + idx);
1938 rw_exit(&(pgtable->swpg_rwlock));
2102 pgtable_t *pgtable;
2108 pgtable = xlate->xlt_pgtable;
2119 shwp = (hw_pdte_t *)(pgtable->hwpg_vaddr) + idx;
2195 /* Set next level pgtable-paddr for PDE */
2244 pgtable_t *pgtable;
2253 /* start with highest level pgtable i.e. root */
2260 pgtable = xlate->xlt_pgtable;
2262 /* Lock the pgtable in READ mode first */
2263 rw_enter(&(pgtable->swpg_rwlock), RW_READER);
2266 hwp = (hw_pdte_t *)(pgtable->hwpg_vaddr) + idx;
2267 next = (pgtable->swpg_next_array)[idx];
2270 * check if leafier level already has a pgtable
2282 "pgtable alloc err");
2289 rw_tryupgrade(&(pgtable->swpg_rwlock)) == 0) {
2290 rw_exit(&(pgtable->swpg_rwlock));
2291 rw_enter(&(pgtable->swpg_rwlock), RW_WRITER);
2297 (pgtable->swpg_next_array)[idx] = next;
2301 rw_downgrade(&(pgtable->swpg_rwlock));
2327 rw_exit(&(pgtable->swpg_rwlock));
2373 /* set all matching ptes that fit into this leaf pgtable */
2415 /* clear all matching ptes that fit into this leaf pgtable */