aboutsummaryrefslogtreecommitdiff
path: root/bsd/drm_memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'bsd/drm_memory.h')
-rw-r--r--bsd/drm_memory.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/bsd/drm_memory.h b/bsd/drm_memory.h
index 605b42ae..97f2bb81 100644
--- a/bsd/drm_memory.h
+++ b/bsd/drm_memory.h
@@ -290,6 +290,30 @@ void *DRM(ioremap)(unsigned long offset, unsigned long size)
return pt;
}
+void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size)
+{
+ void *pt;
+
+ if (!size) {
+ DRM_MEM_ERROR(DRM_MEM_MAPPINGS,
+ "Mapping 0 bytes at 0x%08lx\n", offset);
+ return NULL;
+ }
+
+ /* FIXME FOR BSD */
+ if (!(pt = ioremap_nocache(offset, size))) {
+ DRM_OS_SPINLOCK(&DRM(mem_lock));
+ ++DRM(mem_stats)[DRM_MEM_MAPPINGS].fail_count;
+ DRM_OS_SPINUNLOCK(&DRM(mem_lock));
+ return NULL;
+ }
+ DRM_OS_SPINLOCK(&DRM(mem_lock));
+ ++DRM(mem_stats)[DRM_MEM_MAPPINGS].succeed_count;
+ DRM(mem_stats)[DRM_MEM_MAPPINGS].bytes_allocated += size;
+ DRM_OS_SPINUNLOCK(&DRM(mem_lock));
+ return pt;
+}
+
void DRM(ioremapfree)(void *pt, unsigned long size)
{
int alloc_count;