px_fdvma.c revision 4496171313bed39e96f21bc2f9faf2868e267ae3
/*
* 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
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Internal PCI Fast DVMA implementation
*/
#include <sys/sysmacros.h>
#include <sys/ddi_impldefs.h>
#include "px_obj.h"
/*LINTLIBRARY*/
/*
* The following routines are used to implement the sun4u fast dvma
* routines on this bus.
*/
/*ARGSUSED*/
static void
{
if (!npages)
return;
/* make sure we don't exceed reserved boundary */
"%s%d: kaddr_load index(%x)+pgs(%lx) exceeds limit\n",
return;
}
/* construct the dma cookie to be returned */
MMU_MAP_BUF) != DDI_SUCCESS) {
}
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
}
int
{
if (px_disable_fdvma)
return (DDI_FAILURE);
/*
* Check the limit structure.
*/
return (DDI_DMA_BADLIMITS);
/*
* Check the size of the request.
*/
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.
*/
"DDI_DMA_RESERVE: mp=%p dvma=%x npages=%x private=%p\n",
return (DDI_SUCCESS);
}
int
{
if (px_disable_fdvma)
return (DDI_FAILURE);
/* validate fdvma handle */
return (DDI_FAILURE);
}
/* flush all reserved dvma addresses from mmu */
mp->dmai_ndvmapages = 0;
/* see if there is anyone waiting for dvma space */
if (mmu_p->mmu_dvma_clid != 0) {
}
/* free data structures */
/* see if there is anyone waiting for kmem */
if (px_kmem_clid != 0) {
}
return (DDI_SUCCESS);
}
};