iommu.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
int sysio_iommu_tsb_sizes[] = {
#ifdef DEBUG
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
* the spare pool. See startup.c for tsb spare management.
return (DDI_SUCCESS);
tsb_size = i;
return (DDI_SUCCESS);
int i, do_flush = 0;
if (do_flush)
#if defined(IO_MEMUSAGE)
#if defined(IO_MEMUSAGE)
while (walk) {
while (npages) {
npages--;
iotte_ptr++;
int diag_tlb_flush;
KM_SLEEP);
if (diag_tlb_flush)
goto bad;
if (!diag_tlb_flush)
npages--;
iotte_ptr++;
pfnp++;
} while (npages != 0);
return (rval);
bad:
return (rval);
int diag_tlb_flush;
KM_SLEEP);
if (diag_tlb_flush)
pplist++;
if (!diag_tlb_flush)
npages--;
iotte_ptr++;
pfnp++;
} while (npages != 0);
return (rval);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_DMA_BADATTR);
return (DDI_DMA_BADATTR);
return (DDI_DMA_BADATTR);
return (DDI_DMA_NORESOURCES);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
return (DDI_DMA_TOOBIG);
return (DDI_DMA_TOOBIG);
return (DDI_DMA_MAPOK);
int rval;
#ifdef lint
return (DDI_DMA_INUSE);
return (rval);
case DMA_OTYP_VADDR:
case DMA_OTYP_BUFVADDR:
case DMA_OTYP_PAGES:
case DMA_OTYP_PADDR:
goto bad;
goto bad;
goto bad;
if (ioaddr == 0) {
goto bad;
*iotte_ptr =
KM_SLEEP);
return (DDI_DMA_MAPPED);
if (ioaddr == 0) {
goto bad;
if (addr) {
goto bad_nomap;
goto bad_nomap;
if (cp) {
return (DDI_DMA_PARTIAL_MAP);
return (DDI_DMA_MAPPED);
bad:
return (rval);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
int rval;
winsize));
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (rval);
return (DDI_SUCCESS);
flags = 0;
if (addr) {
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
int rval;
return (DDI_DMA_NOMAPPING);
return (DDI_DMA_NOMAPPING);
if (!handlep) {
return (DDI_DMA_MAPOK);
return (DDI_DMA_NORESOURCES);
addrlow == 0) {
return (rval);
switch (request) {
case DDI_DMA_FREE:
case DDI_DMA_SET_SBUS64:
case DDI_DMA_HTOC:
return (DDI_FAILURE);
case DDI_DMA_KVADDR:
return (DDI_FAILURE);
return (DDI_FAILURE);
case DDI_DMA_NEXTWIN:
int rval;
return (DDI_SUCCESS);
return (DDI_DMA_DONE);
!= DDI_SUCCESS)
return (rval);
return (DDI_DMA_DONE);
case DDI_DMA_NEXTSEG:
return (DDI_DMA_DONE);
case DDI_DMA_SEGTOC:
case DDI_DMA_MOVWIN:
int rval;
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (rval);
case DDI_DMA_REPWIN:
return (DDI_FAILURE);
case DDI_DMA_GETERR:
case DDI_DMA_COFF:
return (DDI_FAILURE);
case DDI_DMA_RESERVE:
return (DDI_DMA_BADLIMITS);
return (DDI_DMA_BADLIMITS);
return (DDI_DMA_NORESOURCES);
if (ioaddr == 0) {
return (DDI_DMA_NOMAPPING);
KM_SLEEP);
sizeof (int), KM_SLEEP);
for (i = 0; i < np; i++)
case DDI_DMA_RELEASE:
npages--;
iotte_ptr++;
sizeof (uint64_t));
return (DDI_FAILURE);
return (DDI_SUCCESS);
int npages;
KM_SLEEP);
npages--;
iotte_ptr++;
pfnp++;
} while (npages > 0);