diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2001-04-30 16:18:22 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2001-04-30 16:18:22 +0000 |
commit | b804c09d0699131a8333c19a4d58cb14125d413e (patch) | |
tree | 3797238ff3bba8aaf25eee1b0dd1bf04c8e8db82 /linux/i810_dma.c | |
parent | df76f812924e4db284fd38b3c5db6b87ec0d82fc (diff) |
fix build of i810 kernel driver for 2.4.3 or greater kernels
Diffstat (limited to 'linux/i810_dma.c')
-rw-r--r-- | linux/i810_dma.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 4c90496a..8a5503ea 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -182,7 +182,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp) if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL; if(VM_DONTCOPY != 0) { - down(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + down( ¤t->mm->mmap_sem ); +#else + down_write( ¤t->mm->mmap_sem ); +#endif old_fops = filp->f_op; filp->f_op = &i810_buffer_fops; dev_priv->mmap_buffer = buf; @@ -198,7 +202,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp) retcode = (signed int)buf_priv->virtual; buf_priv->virtual = 0; } - up(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + up( ¤t->mm->mmap_sem ); +#else + up_write( ¤t->mm->mmap_sem ); +#endif } else { buf_priv->virtual = buf_priv->kernel_virtual; buf_priv->currently_mapped = I810_BUF_MAPPED; @@ -214,7 +222,11 @@ static int i810_unmap_buffer(drm_buf_t *buf) if(VM_DONTCOPY != 0) { if(buf_priv->currently_mapped != I810_BUF_MAPPED) return -EINVAL; - down(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + down( ¤t->mm->mmap_sem ); +#else + down_write( ¤t->mm->mmap_sem ); +#endif #if LINUX_VERSION_CODE < 0x020399 retcode = do_munmap((unsigned long)buf_priv->virtual, (size_t) buf->total); @@ -223,7 +235,11 @@ static int i810_unmap_buffer(drm_buf_t *buf) (unsigned long)buf_priv->virtual, (size_t) buf->total); #endif - up(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + up( ¤t->mm->mmap_sem ); +#else + up_write( ¤t->mm->mmap_sem ); +#endif } buf_priv->currently_mapped = I810_BUF_UNMAPPED; buf_priv->virtual = 0; |