gfxp_vm.c revision b9ae6f870f313422d793ca2506497dd04c858bdd
/*
* 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"
#include <vm/seg_kmem.h>
#include <sys/ddi_impldefs.h>
#include <sys/visual_io.h>
#include <sys/ddidmareq.h>
#include <sys/tnf_probe.h>
#include "gfx_private.h"
/*
* Create a kva mapping for a pa (start..start+size) with
* the specified cache attributes (mode).
*/
{
int hat_flags;
if (size == 0)
return (0);
if (mode == GFXP_MEMORY_CACHED)
else if (mode == GFXP_MEMORY_WRITECOMBINED)
else /* GFXP_MEMORY_UNCACHED */
return (NULL);
}
/*
* Destroy the mapping created by gfxp_map_kernel_space().
* Physical memory is not reclaimed.
*/
void
{
return;
}
/*
* For a VA return the pfn
*/
int
{
return (0);
}
/*
* This causes severe coherency problems when the pages are exported to
* each page, until ddi_dma_mem_alloc() returns KVAs with the correct
* cache attributes.
*/
void
{
return;
if (cache_attr == GFXP_MEMORY_UNCACHED) {
hat_attr &= ~HAT_ORDER_MASK;
} else if (cache_attr == GFXP_MEMORY_WRITECOMBINED) {
hat_attr &= ~HAT_ORDER_MASK;
} else
return;
hat_attr |= HAT_NOSYNC;
}
}
int
{
int cache_attr;
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
else
return (DDI_SUCCESS);
return (DDI_SUCCESS);
}
int
{
int error = 0;
if (error)
return (error);
}
int
{
int error = 0;
if (error)
return (error);
}