diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2003-06-24 18:16:22 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2003-06-24 18:16:22 +0000 |
commit | 03e95cf27a727d656a912be4504df31fdcdc970c (patch) | |
tree | 70a31dff218a9f8782c2bfafbe52c9e6d217a80a | |
parent | 52c2679ac8448adb7a9ae739fb7ac5f21fe119c0 (diff) |
fudge up the kernel driver a bit so we can compile and load the module andsavage-1_0_0-20031002-trunk-premergesavage-1_0_0-branch
then test the 2D setup
-rw-r--r-- | linux-core/savage_drv.c | 17 | ||||
-rw-r--r-- | linux/savage_drv.c | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/linux-core/savage_drv.c b/linux-core/savage_drv.c index cea08beb..cf0f3b47 100644 --- a/linux-core/savage_drv.c +++ b/linux-core/savage_drv.c @@ -40,6 +40,11 @@ /* Currently Savage4 not implement DMA */ /* mark off by Jiayo Hsu, Oct. 23, 2001*/ +#ifdef DO_MUNMAP_4_ARGS +#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1) +#else +#define DO_MUNMAP(m, a, l) do_munmap(m, a, l) +#endif #define DRIVER_IOCTLS \ [DRM_IOCTL_NR(DRM_IOCTL_SAVAGE_ALLOC_CONTINUOUS_MEM)] \ @@ -97,10 +102,10 @@ int savage_alloc_continuous_mem(struct inode *inode, struct file *filp, /*Map the memory to user space*/ down_write(¤t->mm->mmap_sem); addr=do_mmap(NULL,0,size,PROT_READ|PROT_WRITE,MAP_PRIVATE,cont_mem.phyaddress); - if (addr<=0) + if (addr <= 0) return -EFAULT; pgprot_val(flags)=_PAGE_PRESENT | _PAGE_RW |_PAGE_USER ; - if (remap_page_range(addr,cont_mem.phyaddress,size,flags)) + if (remap_page_range(DRM_RPR_ARG(NULL) addr,cont_mem.phyaddress,size,flags)) return -EFAULT; up_write(¤t->mm->mmap_sem); @@ -164,7 +169,7 @@ int savage_get_physics_address(struct inode *inode, struct file *filp, pgd=pgd_offset(mm,buf); pmd=pmd_offset(pgd,buf); - pte=pte_offset(pmd,buf); + pte=pte_offset_kernel(pmd,buf); if (!pte_present(*pte)) return -EFAULT; @@ -215,11 +220,7 @@ int savage_free_cont_mem(struct inode *inode, struct file *filp, DRM(free)(list, sizeof(*list), DRM_MEM_MAPS); /*unmap the user space */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,18)) - if ( do_munmap(current->mm,cont_mem.linear,size,1)!=0) -#else - if ( do_munmap(current->mm,cont_mem.linear,size)!=0) -#endif + if ( DO_MUNMAP(current->mm,cont_mem.linear,size)!=0) return -EFAULT; /*free the page*/ free_pages((unsigned long)map->handle, get_order(size)); diff --git a/linux/savage_drv.c b/linux/savage_drv.c index cea08beb..cf0f3b47 100644 --- a/linux/savage_drv.c +++ b/linux/savage_drv.c @@ -40,6 +40,11 @@ /* Currently Savage4 not implement DMA */ /* mark off by Jiayo Hsu, Oct. 23, 2001*/ +#ifdef DO_MUNMAP_4_ARGS +#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1) +#else +#define DO_MUNMAP(m, a, l) do_munmap(m, a, l) +#endif #define DRIVER_IOCTLS \ [DRM_IOCTL_NR(DRM_IOCTL_SAVAGE_ALLOC_CONTINUOUS_MEM)] \ @@ -97,10 +102,10 @@ int savage_alloc_continuous_mem(struct inode *inode, struct file *filp, /*Map the memory to user space*/ down_write(¤t->mm->mmap_sem); addr=do_mmap(NULL,0,size,PROT_READ|PROT_WRITE,MAP_PRIVATE,cont_mem.phyaddress); - if (addr<=0) + if (addr <= 0) return -EFAULT; pgprot_val(flags)=_PAGE_PRESENT | _PAGE_RW |_PAGE_USER ; - if (remap_page_range(addr,cont_mem.phyaddress,size,flags)) + if (remap_page_range(DRM_RPR_ARG(NULL) addr,cont_mem.phyaddress,size,flags)) return -EFAULT; up_write(¤t->mm->mmap_sem); @@ -164,7 +169,7 @@ int savage_get_physics_address(struct inode *inode, struct file *filp, pgd=pgd_offset(mm,buf); pmd=pmd_offset(pgd,buf); - pte=pte_offset(pmd,buf); + pte=pte_offset_kernel(pmd,buf); if (!pte_present(*pte)) return -EFAULT; @@ -215,11 +220,7 @@ int savage_free_cont_mem(struct inode *inode, struct file *filp, DRM(free)(list, sizeof(*list), DRM_MEM_MAPS); /*unmap the user space */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,18)) - if ( do_munmap(current->mm,cont_mem.linear,size,1)!=0) -#else - if ( do_munmap(current->mm,cont_mem.linear,size)!=0) -#endif + if ( DO_MUNMAP(current->mm,cont_mem.linear,size)!=0) return -EFAULT; /*free the page*/ free_pages((unsigned long)map->handle, get_order(size)); |