FreeBSD/sys/sparc64/sparc64/iommu.c
/*
 * Perform an IOMMU diagnostic access and print the tag belonging to va.
 */
Perform an IOMMU diagnostic access and print the tag belonging to va.
Perform an IOMMU diagnostic access and print the tag belonging to va .
static void
iommu_diag(struct iommu_state *is, vm_offset_t va)
{
	int i;
	uint64_t data, tag;
	if ((is->is_flags & IOMMU_FIRE) != 0)
		return;
	IS_LOCK_ASSERT(is);
	IOMMU_WRITE8(is, is_dva, 0, trunc_io_page(va));
	membar(StoreStore | StoreLoad);
	printf("%s: tte entry %#lx", __func__, IOMMU_GET_TTE(is, va));
	if (is->is_dtcmp != 0) {
		printf(", tag compare register is %#lx\n",
		    IOMMU_READ8(is, is_dtcmp, 0));
	} else
		printf("\n");
	for (i = 0; i < 16; i++) {
		tag = IOMMU_READ8(is, is_dtag, i * 8);
		data = IOMMU_READ8(is, is_ddram, i * 8);
		printf("%s: tag %d: %#lx, vpn %#lx, err %lx; "
		    "data %#lx, pa %#lx, v %d, c %d\n", __func__, i,
		    tag, (tag & IOMMU_DTAG_VPNMASK) << IOMMU_DTAG_VPNSHIFT,
		    (tag & IOMMU_DTAG_ERRMASK) >> IOMMU_DTAG_ERRSHIFT, data,
		    (data & IOMMU_DDATA_PGMASK) << IOMMU_DDATA_PGSHIFT,
		    (data & IOMMU_DDATA_V) != 0, (data & IOMMU_DDATA_C) != 0);
	}
}
static void iommu_diag ( struct iommu_state * is , vm_offset_t va ) { int i ; uint64_t data , tag ; if ( ( is -> is_flags & IOMMU_FIRE ) != 0 ) return ; IS_LOCK_ASSERT ( is ) ; IOMMU_WRITE8 ( is , is_dva , 0 , trunc_io_page ( va ) ) ; membar ( StoreStore | StoreLoad ) ; printf ( " " , __func__ , IOMMU_GET_TTE ( is , va ) ) ; if ( is -> is_dtcmp != 0 ) { printf ( " \n " , IOMMU_READ8 ( is , is_dtcmp , 0 ) ) ; } else printf ( " \n " ) ; for ( i = 0 ; i < 16 ; i ++ ) { tag = IOMMU_READ8 ( is , is_dtag , i * 8 ) ; data = IOMMU_READ8 ( is , is_ddram , i * 8 ) ; printf ( " " " \n " , __func__ , i , tag , ( tag & IOMMU_DTAG_VPNMASK ) << IOMMU_DTAG_VPNSHIFT , ( tag & IOMMU_DTAG_ERRMASK ) >> IOMMU_DTAG_ERRSHIFT , data , ( data & IOMMU_DDATA_PGMASK ) << IOMMU_DDATA_PGSHIFT , ( data & IOMMU_DDATA_V ) != 0 , ( data & IOMMU_DDATA_C ) != 0 ) ; } }
Perform an IOMMU diagnostic access and print the tag belonging to va.
Perform an IOMMU diagnostic access and print the tag belonging to va .