summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2008-05-04 21:43:01 +0000
committerjmcneill <jmcneill@NetBSD.org>2008-05-04 21:43:01 +0000
commitdc2a8d24fc20362e0710945d3cfd88062bf370ad (patch)
tree2c588dca0cd46a6a1f93d87c65b1061d8f8d49b0 /sys/dev
parent7846a186971416e5e7456f056667d244f1d215f5 (diff)
Ugh, unbreak _DRM_SHM on amd64 again.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/drm/drm_vm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/drm/drm_vm.c b/sys/dev/drm/drm_vm.c
index 2f14cd310dc..64e20ab8fb3 100644
--- a/sys/dev/drm/drm_vm.c
+++ b/sys/dev/drm/drm_vm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_vm.c,v 1.9 2008/05/04 20:27:50 jmcneill Exp $ */
+/* $NetBSD: drm_vm.c,v 1.10 2008/05/04 21:43:01 jmcneill Exp $ */
/*-
* Copyright 2003 Eric Anholt
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vm.c,v 1.9 2008/05/04 20:27:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vm.c,v 1.10 2008/05/04 21:43:01 jmcneill Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/drm_vm.c,v 1.2 2005/11/28 23:13:53 anholt Exp $");
*/
@@ -41,6 +41,7 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot)
drm_file_t *priv;
drm_map_type_t type;
paddr_t phys;
+ uintptr_t roffset;
DRM_LOCK();
priv = drm_find_file_by_proc(dev, DRM_CURPROC);
@@ -82,9 +83,10 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot)
for performance, even if the list was a
bit longer. */
DRM_LOCK();
+ roffset = DRM_NETBSD_HANDLE2ADDR(offset);
TAILQ_FOREACH(map, &dev->maplist, link) {
if (map->type == _DRM_SHM) {
- if (offset >= (uintptr_t)map->handle && offset < (uintptr_t)map->handle + map->size)
+ if (roffset >= (uintptr_t)map->handle && roffset < (uintptr_t)map->handle + map->size)
break;
} else {
if (offset >= map->offset && offset < map->offset + map->size)