gfxp_devmap.c revision fc1821fee2e1f208a4b5ff3e229e97b87979208a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ddi_impldefs.h>
#include "gfx_private.h"
/*
* Create a dummy ddi_umem_cookie given to gfxp_devmap_umem_setup().
*/
{
struct ddi_umem_cookie *umem_cookie;
if (umem_cookie == NULL)
return (NULL);
return ((ddi_umem_cookie_t *)umem_cookie);
}
void
{
}
/*
* called by driver devmap routine to pass kernel virtual address mapping
* info to the framework. used only for kernel memory
* allocated from ddi_dma_mem_alloc().
*/
/*ARGSUSED*/
int
{
#ifdef lint
#endif
return (DDI_FAILURE);
/* For UMEM_TRASH, this restriction is not needed */
return (DDI_FAILURE);
/*
* First to check if this function has been called for this dhp.
*/
return (DDI_FAILURE);
return (DDI_FAILURE);
if (flags & DEVMAP_MAPPING_INVALID) {
/*
* If DEVMAP_MAPPING_INVALID is specified, we have to grant
* remap permission.
*/
if (!(flags & DEVMAP_ALLOW_REMAP)) {
return (DDI_FAILURE);
}
} else {
}
switch (accattrp->devacc_attr_dataorder) {
case DDI_STRICTORDER_ACC:
break;
case DDI_UNORDERED_OK_ACC:
break;
case DDI_MERGING_OK_ACC:
break;
case DDI_LOADCACHING_OK_ACC:
break;
case DDI_STORECACHING_OK_ACC:
break;
default:
return (DDI_FAILURE);
}
}
#ifdef __sparc
if (accattrp->devacc_attr_endian_flags ==
}
}
#endif
/*
* The default is _not_ to pass HAT_LOAD_NOCONSIST to hat_devload();
* we pass HAT_LOAD_NOCONSIST _only_ in cases where hat tries to
* create consistent mappings but our intention was to create
* non-consistent mappings.
*
* DEVMEM: hat figures it out it's DEVMEM and creates non-consistent
* mappings.
*
* kernel exported memory: hat figures it out it's memory and always
* creates consistent mappings.
*
*
* MAP_FIXED. We _explicitly_ tell hat to create non-consistent
* mappings by passing HAT_LOAD_NOCONSIST in case of MAP_FIXED
*/
/* Only some of the flags bits are settable by the driver */
if (callbackops != NULL) {
sizeof (struct devmap_callback_ctl));
}
/*
* Initialize dh_lock if we want to do remap.
*/
}
return (DDI_SUCCESS);
}