/*
*/
/*
* 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, 2012, 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"
#ifdef __x86
#include "drm_linux_list.h"
#endif
/* Device memory access structure */
typedef struct drm_device_iomap {
void *
{
}
void *
{
}
void *
{
void *pt;
DRM_ERROR("pt is NULL strange");
return (NULL);
}
}
return (pt);
}
void
{
if (pt)
}
int
{
int len;
int nregs, i;
int regnum;
regnum = -1;
DRM_ERROR("ddi_dev_nregs() failed");
return (-1);
}
DRM_ERROR("ddi_getlongprop() failed");
if (regs)
return (-1);
}
for (i = 0; i < nregs; i ++) {
regnum = i + 1;
break;
}
}
if (regs)
return (regnum);
}
/* data access attributes structure for register access */
#ifdef _BIG_ENDIAN
#else
#endif
};
static int
{
int regnum;
int ret;
if (regnum < 0) {
DRM_ERROR("can not find register entry: "
return -ENXIO;
}
if (ret != DDI_SUCCESS) {
DRM_ERROR("failed to map regs: "
return -EFAULT;
}
return 0;
}
int
{
int ret;
DRM_DEBUG("\n");
if (ret) {
DRM_ERROR("__ioremap failed: paddr=0x%lx, size=0x%lx",
return (ret);
}
"map->handle=%p, map->size=%lx",
return (0);
}
void
{
if (map->acc_handle)
}
#ifdef __x86
struct drm_iomem {
void *addr;
};
void *
{
void *addr;
if (mode == DRM_MEM_CACHED)
else if (mode == DRM_MEM_UNCACHED)
else if (mode == DRM_MEM_WC)
else
return (NULL);
if(!addr)
return (NULL);
if(!iomem){
return (NULL);
}
return (addr);
}
void
{
break;
}
}
}
#endif /* x86 */