/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* drm_memory.h -- Memory management wrappers for DRM -*- linux-c -*-
* Created: Thu Feb 4 14:00:34 1999 by faith@valinux.com
*/
/*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* Copyright (c) 2009, Intel Corporation.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Rickard E. (Rik) Faith <faith@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*
*/
#include "drmP.h"
/* Device memory access structure */
typedef struct drm_device_iomap {
void
drm_mem_init(void)
{
}
void
drm_mem_uninit(void)
{
}
/*ARGSUSED*/
void *
{
}
/*ARGSUSED*/
void *
{
}
/*ARGSUSED*/
void *
{
void *pt;
DRM_ERROR("pt is NULL strange");
return (NULL);
}
}
return (pt);
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
int
{
int length;
int n_reg, i;
int regnum;
regnum = -1;
DRM_ERROR("drm_get_pci_index_reg:ddi_dev_nregs failed\n");
n_reg = 0;
return (-1);
}
DRM_ERROR("drm_get_pci_index_reg: ddi_getlongprop failed!\n");
goto error;
}
for (i = 0; i < n_reg; i ++) {
regnum = i + 1;
break;
}
}
return (regnum);
return (-1);
}
/* data access attributes structure for register access */
};
int
{
int regnum;
int ret;
if (regnum < 0) {
DRM_ERROR("do_ioremap: can not find regster entry,"
return (ENXIO);
}
if (ret < 0) {
DRM_ERROR("do_ioremap: failed to map regs: regno=%d,"
return (EFAULT);
}
return (0);
}
int
{
int ret;
DRM_DEBUG("drm_ioremap called\n");
if (ret) {
DRM_ERROR("drm_ioremap: failed, physaddr=0x%x, size=0x%x",
return (ret);
}
/* ddi_acc_handle_t */
"map->handle is %p map->dev_addr is %lx map->size %x",
return (0);
}
void
{
DRM_ERROR("drm_ioremapfree: handle is NULL");
return;
}
}