summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-04-03 07:50:30 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-04-03 07:50:30 +0000
commit4259e5e61716d321aa3c1ac6d7ad4bf0e3c39a38 (patch)
treedb8ac8a4e46b731ab023b7b33cf9cf103454411d /linux-core
parent62d49315299f4483b2e7fb44f21d6b09cef01afd (diff)
make 2.4.2 -> 2.4.3 change conditional. works with older than 2.4.3 kernels
again.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bufs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index f310eced..d3ca48b4 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -768,18 +768,34 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
goto done;
}
+#if LINUX_VERSION_CODE < 0x020402
+ down( &current->mm->mmap_sem );
+#else
down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, map->size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
(unsigned long)map->offset );
+#if LINUX_VERSION_CODE < 0x020402
+ up( &current->mm->mmap_sem );
+#else
up_write( &current->mm->mmap_sem );
+#endif
} else {
+#if LINUX_VERSION_CODE < 0x020402
+ down( &current->mm->mmap_sem );
+#else
down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, dma->byte_count,
PROT_READ | PROT_WRITE,
MAP_SHARED, 0 );
+#if LINUX_VERSION_CODE < 0x020402
+ up( &current->mm->mmap_sem );
+#else
up_write( &current->mm->mmap_sem );
+#endif
}
if ( virtual > -1024UL ) {
/* Real error */