/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* Internal PCI Fast DVMA implementation
*/
#include <sys/sysmacros.h>
#include <sys/ddi_impldefs.h>
/*LINTLIBRARY*/
/*
* The following routines are used to implement the sun4u fast dvma
* routines on this bus.
*/
/*ARGSUSED*/
static void
{
int i;
if (!npages)
return;
/* make sure we don't exceed reserved boundary */
"%s%d: kaddr_load index(%x)+pgs(%lx) exceeds limit\n",
return;
}
/* better have not already loaded something at this address */
/* construct the dma cookie to be returned */
if (pci_dvma_remap_enabled) {
(void) hat_add_callback(pci_fast_dvma_cbid, a,
} else {
}
if (pfn == PFN_INVALID)
goto bad_pfn;
if (i == 0) /* setup template, all bits except pfn value */
/* XXX assumes iommu and mmu has same page size */
}
return;
}
/*ARGSUSED*/
static void
{
if (!pci_dvma_sync_before_unmap) {
if (PCI_DMA_CANRELOC(mp))
index);
}
if (sync_flags != -1)
if (pci_dvma_sync_before_unmap) {
if (PCI_DMA_CANRELOC(mp))
index);
}
}
/*ARGSUSED*/
static void
{
}
int
{
if (pci_disable_fdvma)
return (DDI_FAILURE);
/*
* Check the limit structure.
*/
return (DDI_DMA_BADLIMITS);
/*
* Allocate DVMA space from reserve.
*/
-npages) < 0) {
return (DDI_DMA_NORESOURCES);
}
/*
* Allocate the dma handle.
*/
/*
* Get entries from dvma space map.
* (vmem_t *vmp,
* size_t size, size_t align, size_t phase,
* size_t nocross, void *minaddr, void *maxaddr, int vmflag)
*/
if (dvma_pg == 0) {
return (DDI_DMA_NOMAPPING);
}
/*
* Create the fast dvma request structure.
*/
/*
* Initialize the handle.
*/
"PCI_DVMA_RESERVE: mp=%p dvma=%x npages=%x private=%p\n",
return (DDI_SUCCESS);
}
int
{
if (pci_disable_fdvma)
return (DDI_FAILURE);
/* validate fdvma handle */
return (DDI_FAILURE);
}
/* flush all reserved dvma addresses from iommu */
mp->dmai_ndvmapages = 0;
/* see if there is anyone waiting for dvma space */
if (iommu_p->iommu_dvma_clid != 0) {
}
/* free data structures */
/* see if there is anyone waiting for kmem */
if (pci_kmem_clid != 0) {
}
return (DDI_SUCCESS);
}
/*
* fast dvma ops structure:
*/
};