diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2002-03-06 19:30:45 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2002-03-06 19:30:45 +0000 |
commit | 46cacdca855a99c1ffe0ccf7a7f88134bca9bade (patch) | |
tree | 038b0f31082031de70f91a4b8bd7ea66ea9dc105 /bsd-core/drm_memory.c | |
parent | ab87c5d0d1b5c35006ce8b99a9260e3116c732dc (diff) |
first pass at merging mesa 4.0 kernel drivers into new bsd-3-0-0 branch.
Diffstat (limited to 'bsd-core/drm_memory.c')
-rw-r--r-- | bsd-core/drm_memory.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c index 605b42ae..97f2bb81 100644 --- a/bsd-core/drm_memory.c +++ b/bsd-core/drm_memory.c @@ -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; |