diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2001-08-19 15:34:17 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2001-08-19 15:34:17 +0000 |
commit | b577361368a6801550f6be268d357fe31449db5c (patch) | |
tree | f969410b03c0f629b3162bbf1d8e0e12aff64560 | |
parent | 4d738200dd4df9b0656c2ec49da2694cc4e7f5c7 (diff) |
remove Linux 2.2.x cruft from bsd-2-0-0 branch.
-rw-r--r-- | linux-core/ati_pcigart.c | 6 | ||||
-rw-r--r-- | linux-core/drmP.h | 2 | ||||
-rw-r--r-- | linux-core/drm_agpsupport.c | 8 | ||||
-rw-r--r-- | linux-core/drm_bufs.c | 4 | ||||
-rw-r--r-- | linux-core/drm_drv.c | 24 | ||||
-rw-r--r-- | linux-core/drm_fops.c | 18 | ||||
-rw-r--r-- | linux-core/drm_memory.h | 15 | ||||
-rw-r--r-- | linux-core/drm_os_linux.h | 26 | ||||
-rw-r--r-- | linux-core/drm_scatter.c | 6 | ||||
-rw-r--r-- | linux-core/drm_stub.c | 8 | ||||
-rw-r--r-- | linux-core/drm_vm.c | 88 | ||||
-rw-r--r-- | linux-core/i810_dma.c | 5 | ||||
-rw-r--r-- | linux/Makefile.linux | 5 | ||||
-rw-r--r-- | linux/agpsupport-pre24.h | 115 | ||||
-rw-r--r-- | linux/ati_pcigart.h | 6 | ||||
-rw-r--r-- | linux/compat-pre24.h | 51 | ||||
-rw-r--r-- | linux/drmP.h | 2 | ||||
-rw-r--r-- | linux/drm_agpsupport.h | 8 | ||||
-rw-r--r-- | linux/drm_bufs.h | 4 | ||||
-rw-r--r-- | linux/drm_drv.h | 24 | ||||
-rw-r--r-- | linux/drm_fops.h | 18 | ||||
-rw-r--r-- | linux/drm_memory.h | 15 | ||||
-rw-r--r-- | linux/drm_os_linux.h | 26 | ||||
-rw-r--r-- | linux/drm_scatter.h | 6 | ||||
-rw-r--r-- | linux/drm_stub.h | 8 | ||||
-rw-r--r-- | linux/drm_vm.h | 88 | ||||
-rw-r--r-- | linux/i810_dma.c | 5 | ||||
-rw-r--r-- | linux/r128_cce.c | 2 | ||||
-rw-r--r-- | linux/radeon_cp.c | 2 | ||||
-rw-r--r-- | linux/stubsupport-pre24.h | 44 |
30 files changed, 18 insertions, 621 deletions
diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c index a794b3e0..d5d7c0ad 100644 --- a/linux-core/ati_pcigart.c +++ b/linux-core/ati_pcigart.c @@ -103,7 +103,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, goto done; } -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) if ( !dev->pdev ) { DRM_ERROR( "PCI device unknown!\n" ); goto done; @@ -130,7 +130,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) ); for ( i = 0 ; i < pages ; i++ ) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) /* we need to support large memory configurations */ entry->busaddr[i] = pci_map_single(dev->pdev, page_address( entry->pagelist[i] ), @@ -171,7 +171,7 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev, unsigned long addr, dma_addr_t bus_addr) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) drm_sg_mem_t *entry = dev->sg; unsigned long pages; int i; diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 434d5462..fdad8b42 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -406,7 +406,7 @@ typedef struct drm_sg_mem { void *virtual; int pages; struct page **pagelist; -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) dma_addr_t *busaddr; #endif } drm_sg_mem_t; diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index 66d1defc..b4b85abd 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -35,12 +35,8 @@ #if __REALLY_HAVE_AGP -#if LINUX_VERSION_CODE < 0x020400 -#include "agpsupport-pre24.h" -#else #define DRM_AGP_GET (drm_agp_t *)inter_module_get("drm_agp") #define DRM_AGP_PUT inter_module_put("drm_agp") -#endif static const drm_agp_t *drm_agp = NULL; @@ -271,22 +267,18 @@ drm_agp_head_t *DRM(agp_init)(void) case INTEL_GX: head->chipset = "Intel 440GX"; break; case INTEL_I810: head->chipset = "Intel i810"; break; -#if LINUX_VERSION_CODE >= 0x020400 case INTEL_I815: head->chipset = "Intel i815"; break; case INTEL_I840: head->chipset = "Intel i840"; break; case INTEL_I850: head->chipset = "Intel i850"; break; -#endif case VIA_GENERIC: head->chipset = "VIA"; break; case VIA_VP3: head->chipset = "VIA VP3"; break; case VIA_MVP3: head->chipset = "VIA MVP3"; break; -#if LINUX_VERSION_CODE >= 0x020400 case VIA_MVP4: head->chipset = "VIA MVP4"; break; case VIA_APOLLO_KX133: head->chipset = "VIA Apollo KX133"; break; case VIA_APOLLO_KT133: head->chipset = "VIA Apollo KT133"; break; -#endif case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro"; break; diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index 55234a01..6664d040 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -318,11 +318,7 @@ int DRM(rmmap)( DRM_OS_IOCTL ) #ifdef __linux__ for (pt = dev->vmalist, prev = NULL; pt; prev = pt, pt = pt->next) { -#if LINUX_VERSION_CODE >= 0x020300 if (pt->vma->vm_private_data == map) found_maps++; -#else - if (pt->vma->vm_pte == map) found_maps++; -#endif } #endif diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 66aa05a2..72ad3191 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -117,7 +117,6 @@ #endif #ifndef DRIVER_FOPS #ifdef __linux__ -#if LINUX_VERSION_CODE >= 0x020400 #define DRIVER_FOPS \ static struct file_operations DRM(fops) = { \ owner: THIS_MODULE, \ @@ -130,19 +129,6 @@ static struct file_operations DRM(fops) = { \ fasync: DRM(fasync), \ poll: DRM(poll), \ } -#else -#define DRIVER_FOPS \ -static struct file_operations DRM(fops) = { \ - open: DRM(open), \ - flush: DRM(flush), \ - release: DRM(release), \ - ioctl: DRM(ioctl), \ - mmap: DRM(mmap), \ - read: DRM(read), \ - fasync: DRM(fasync), \ - poll: DRM(poll), \ -} -#endif #endif /* __linux__ */ #ifdef __FreeBSD__ #if DRM_LINUX @@ -978,11 +964,6 @@ int DRM( open)(dev_t kdev, int flags, int fmt, struct proc *p) #endif if ( !retcode ) { -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020333 - MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif -#endif atomic_inc( &dev->counts[_DRM_STAT_OPENS] ); DRM_OS_SPINLOCK( &dev->count_lock ); if ( !dev->open_count++ ) { @@ -1157,11 +1138,6 @@ int DRM( close)(dev_t kdev, int flags, int fmt, struct proc *p) * End inline drm_release */ -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif -#endif atomic_inc( &dev->counts[_DRM_STAT_CLOSES] ); DRM_OS_SPINLOCK( &dev->count_lock ); if ( !--dev->open_count ) { diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index d94d8811..6bd43596 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -299,28 +299,10 @@ int DRM(write_string)(drm_device_t *dev, const char *s) } #ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020315 && !defined(KILLFASYNCHASTHREEPARAMETERS) - /* The extra parameter to kill_fasync was added in 2.3.21, and is - _not_ present in _stock_ 2.2.14 and 2.2.15. However, some - distributions patch 2.2.x kernels to add this parameter. The - Makefile.linux attempts to detect this addition and defines - KILLFASYNCHASTHREEPARAMETERS if three parameters are found. */ - if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO); -#else - - /* Parameter added in 2.3.21. */ -#if LINUX_VERSION_CODE < 0x020400 - if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN); -#else - /* Type of first parameter changed in - Linux 2.4.0-test2... */ if (dev->buf_async) kill_fasync(&dev->buf_async, SIGIO, POLL_IN); -#endif -#endif DRM_DEBUG("waking\n"); wake_up_interruptible(&dev->buf_readers); #endif - #ifdef __FreeBSD__ if (dev->buf_selecting) { dev->buf_selecting = 0; diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index 24f59ae5..8619c345 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -115,13 +115,8 @@ void DRM(mem_init)(void) #ifdef __linux__ si_meminfo(&si); -#if LINUX_VERSION_CODE < 0x020317 - /* Changed to page count in 2.3.23 */ - DRM(ram_available) = si.totalram >> PAGE_SHIFT; -#else DRM(ram_available) = si.totalram; #endif -#endif #ifdef __FreeBSD__ DRM(ram_available) = 0; /* si.totalram */ #endif @@ -359,12 +354,7 @@ unsigned long DRM(alloc_pages)(int order, int area) for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { -#if LINUX_VERSION_CODE >= 0x020400 - /* Argument type changed in 2.4.0-test6/pre8 */ mem_map_reserve(virt_to_page(addr)); -#else - mem_map_reserve(MAP_NR(addr)); -#endif } #endif @@ -387,12 +377,7 @@ void DRM(free_pages)(unsigned long address, int order, int area) for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { -#if LINUX_VERSION_CODE >= 0x020400 - /* Argument type changed in 2.4.0-test6/pre8 */ mem_map_unreserve(virt_to_page(addr)); -#else - mem_map_unreserve(MAP_NR(addr)); -#endif } free_pages(address, order); #endif diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h index 55a7a3cd..ffae2c08 100644 --- a/linux-core/drm_os_linux.h +++ b/linux-core/drm_os_linux.h @@ -31,13 +31,8 @@ #include <linux/types.h> #include <linux/agp_backend.h> #endif -#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ #include <linux/tqueue.h> #include <linux/poll.h> -#endif -#if LINUX_VERSION_CODE < 0x020400 -#include "compat-pre24.h" -#endif #include <asm/pgalloc.h> #include "drm.h" @@ -60,12 +55,7 @@ typedef struct wait_queue *wait_queue_head_t; #define _PAGE_PSE _PAGE_4M #endif - /* vm_offset changed to vm_pgoff in 2.3.25 */ -#if LINUX_VERSION_CODE < 0x020319 -#define VM_OFFSET(vma) ((vma)->vm_offset) -#else #define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT) -#endif /* *_nopage return values defined in 2.3.26 */ #ifndef NOPAGE_SIGBUS @@ -361,21 +351,6 @@ extern int DRM(mapbufs)( DRM_OS_IOCTL ); #endif /* Mapping support (drm_vm.h) */ -#if LINUX_VERSION_CODE < 0x020317 -extern unsigned long DRM(vm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -#else - /* Return type changed in 2.3.23 */ extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access); @@ -388,7 +363,6 @@ extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access); -#endif extern void DRM(vm_open)(struct vm_area_struct *vma); extern void DRM(vm_close)(struct vm_area_struct *vma); extern void DRM(vm_shm_close)(struct vm_area_struct *vma); diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c index 66d34968..f0074450 100644 --- a/linux-core/drm_scatter.c +++ b/linux-core/drm_scatter.c @@ -47,7 +47,7 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry ) vfree( entry->virtual ); -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); @@ -99,7 +99,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, return -ENOMEM; } -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); if ( !entry->busaddr ) { @@ -116,7 +116,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); if ( !entry->virtual ) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c index 80bdac61..ead5b959 100644 --- a/linux-core/drm_stub.c +++ b/linux-core/drm_stub.c @@ -31,12 +31,6 @@ #define __NO_VERSION__ #include "drmP.h" -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020400 -#include "stubsupport-pre24.h" -#endif -#endif - #define DRM_STUB_MAXCARDS 16 /* Enough for one machine */ static struct drm_stub_list { @@ -72,9 +66,7 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp) } static struct file_operations DRM(stub_fops) = { -#if LINUX_VERSION_CODE >= 0x020400 owner: THIS_MODULE, -#endif open: DRM(stub_open) }; diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index b5a5deb6..f01d2081 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -56,16 +56,9 @@ struct vm_operations_struct DRM(vm_sg_ops) = { close: DRM(vm_close), }; -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { #if defined(__alpha__) && __REALLY_HAVE_AGP drm_file_t *priv = vma->vm_file->private_data; @@ -122,32 +115,17 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma, baddr, __va(agpmem->memory->memory[offset]), offset); #endif get_page(page); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } #endif return NOPAGE_SIGBUS; /* Disallow mremap */ } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { -#if LINUX_VERSION_CODE >= 0x020300 drm_map_t *map = (drm_map_t *)vma->vm_private_data; -#else - drm_map_t *map = (drm_map_t *)vma->vm_pte; -#endif unsigned long offset; unsigned long i; pgd_t *pgd; @@ -174,11 +152,7 @@ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma, get_page(page); DRM_DEBUG("0x%08lx => 0x%08x\n", address, page_to_bus(page)); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } /* Special close routine which deletes map information if we are the last @@ -197,25 +171,14 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif atomic_dec(&dev->vma_count); -#if LINUX_VERSION_CODE >= 0x020300 map = vma->vm_private_data; -#else - map = vma->vm_pte; -#endif down(&dev->struct_sem); for (pt = dev->vmalist, prev = NULL; pt; pt = next) { next = pt->next; -#if LINUX_VERSION_CODE >= 0x020300 if (pt->vma->vm_private_data == map) found_maps++; -#else - if (pt->vma->vm_pte == map) found_maps++; -#endif if (pt->vma == vma) { if (prev) { prev->next = pt->next; @@ -268,16 +231,9 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) up(&dev->struct_sem); } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { drm_file_t *priv = vma->vm_file->private_data; drm_device_t *dev = priv->dev; @@ -299,29 +255,14 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, DRM_DEBUG("0x%08lx (page %lu) => 0x%08x\n", address, page_nr, page_to_bus(page)); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { -#if LINUX_VERSION_CODE >= 0x020300 drm_map_t *map = (drm_map_t *)vma->vm_private_data; -#else - drm_map_t *map = (drm_map_t *)vma->vm_pte; -#endif drm_file_t *priv = vma->vm_file->private_data; drm_device_t *dev = priv->dev; drm_sg_mem_t *entry = dev->sg; @@ -341,11 +282,7 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, page = entry->pagelist[page_offset]; get_page(page); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } void DRM(vm_open)(struct vm_area_struct *vma) @@ -357,10 +294,6 @@ void DRM(vm_open)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); atomic_inc(&dev->vma_count); -#if LINUX_VERSION_CODE < 0x020333 - /* The map can exist after the fd is closed. */ - MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif vma_entry = DRM(alloc)(sizeof(*vma_entry), DRM_MEM_VMAS); if (vma_entry) { @@ -381,9 +314,6 @@ void DRM(vm_close)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif atomic_dec(&dev->vma_count); down(&dev->struct_sem); @@ -424,11 +354,6 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma) vma->vm_ops = &DRM(vm_dma_ops); vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ -#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */ - /* In Linux 2.2.3 and above, this is - handled in do_mmap() in mm/mmap.c. */ - ++filp->f_count; -#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); return 0; @@ -543,22 +468,14 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) break; case _DRM_SHM: vma->vm_ops = &DRM(vm_shm_ops); -#if LINUX_VERSION_CODE >= 0x020300 vma->vm_private_data = (void *)map; -#else - vma->vm_pte = (unsigned long)map; -#endif /* Don't let this area swap. Change when DRM_KERNEL advisory is supported. */ vma->vm_flags |= VM_LOCKED; break; case _DRM_SCATTER_GATHER: vma->vm_ops = &DRM(vm_sg_ops); -#if LINUX_VERSION_CODE >= 0x020300 vma->vm_private_data = (void *)map; -#else - vma->vm_pte = (unsigned long)map; -#endif vma->vm_flags |= VM_LOCKED; break; default: @@ -566,11 +483,6 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) } vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ -#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */ - /* In Linux 2.2.3 and above, this is - handled in do_mmap() in mm/mmap.c. */ - ++filp->f_count; -#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); return 0; diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 1ab8b930..a85d9b45 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -231,14 +231,9 @@ static int i810_unmap_buffer(drm_buf_t *buf) #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); -#else retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, (size_t) buf->total); -#endif #if LINUX_VERSION_CODE <= 0x020402 up( ¤t->mm->mmap_sem ); #else diff --git a/linux/Makefile.linux b/linux/Makefile.linux index cb48028f..15b9d052 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -53,7 +53,7 @@ LIBS = DRMTEMPLATES = drm_auth.h drm_bufs.h drm_context.h drm_dma.h drm_drawable.h \ drm_drv.h drm_fops.h drm_init.h drm_ioctl.h drm_lists.h \ drm_lock.h drm_memory.h drm_proc.h drm_stub.h drm_vm.h -DRMHEADERS = drm.h drmP.h compat-pre24.h +DRMHEADERS = drm.h drmP.h GAMMAOBJS = gamma_drv.o gamma_dma.o GAMMAHEADERS = gamma_drv.h $(DRMHEADERS) $(DRMTEMPLATES) @@ -145,7 +145,6 @@ endif ifeq ($(AGP),1) MODCFLAGS += -DCONFIG_AGP -DCONFIG_AGP_MODULE DRMTEMPLATES += drm_agpsupport.h -DRMHEADERS += agpsupport-pre24.h MODS += mga.o ifeq ($(MACHINE),i386) MODS += i810.o @@ -185,7 +184,7 @@ all::;@echo === SMP=${SMP} MODULES=${MODULES} MODVERSIONS=${MODVERSIONS} AGP=${A all::;@echo === kill_fasync has $(PARAMS) parameters all::;@echo === Compiling for machine $(MACHINE) all::;@echo === WARNING -all::;@echo === WARNING 2.4.0 kernels before 2.4.0-test11 DO NOT WORK +all::;@echo === WARNING Use 2.4.x kernels ONLY! all::;@echo === WARNING ifeq ($(MODULES),0) diff --git a/linux/agpsupport-pre24.h b/linux/agpsupport-pre24.h deleted file mode 100644 index abcf9f51..00000000 --- a/linux/agpsupport-pre24.h +++ /dev/null @@ -1,115 +0,0 @@ -/* agpsupport-pre24.h -- Support for pre-2.4.0 kernels -*- linux-c -*- - * Created: Mon Nov 13 10:54:15 2000 by faith@valinux.com - * - * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Author: Rickard E. (Rik) Faith <faith@valinux.com> - * - */ - -#ifndef _AGPSUPPORT_PRE24_H_ -#define _AGPSUPPORT_PRE24_H_ -typedef struct { - void (*free_memory)(agp_memory *); - agp_memory *(*allocate_memory)(size_t, u32); - int (*bind_memory)(agp_memory *, off_t); - int (*unbind_memory)(agp_memory *); - void (*enable)(u32); - int (*acquire)(void); - void (*release)(void); - void (*copy_info)(agp_kern_info *); -} drm_agp_t; - -static drm_agp_t drm_agp_struct = { - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; - -/* The C standard says that 'void *' is not guaranteed to hold a function - pointer, so we use this union to define a generic pointer that is - guaranteed to hold any of the function pointers we care about. */ -typedef union { - void (*free_memory)(agp_memory *); - agp_memory *(*allocate_memory)(size_t, u32); - int (*bind_memory)(agp_memory *, off_t); - int (*unbind_memory)(agp_memory *); - void (*enable)(u32); - int (*acquire)(void); - void (*release)(void); - void (*copy_info)(agp_kern_info *); - unsigned long address; -} drm_agp_func_u; - -typedef struct drm_agp_fill { - const char *name; - drm_agp_func_u *f; -} drm_agp_fill_t; - -static drm_agp_fill_t drm_agp_fill[] = { - { __MODULE_STRING(agp_free_memory), - (drm_agp_func_u *)&drm_agp_struct.free_memory }, - { __MODULE_STRING(agp_allocate_memory), - (drm_agp_func_u *)&drm_agp_struct.allocate_memory }, - { __MODULE_STRING(agp_bind_memory), - (drm_agp_func_u *)&drm_agp_struct.bind_memory }, - { __MODULE_STRING(agp_unbind_memory), - (drm_agp_func_u *)&drm_agp_struct.unbind_memory }, - { __MODULE_STRING(agp_enable), - (drm_agp_func_u *)&drm_agp_struct.enable }, - { __MODULE_STRING(agp_backend_acquire), - (drm_agp_func_u *)&drm_agp_struct.acquire }, - { __MODULE_STRING(agp_backend_release), - (drm_agp_func_u *)&drm_agp_struct.release }, - { __MODULE_STRING(agp_copy_info), - (drm_agp_func_u *)&drm_agp_struct.copy_info }, - { NULL, NULL } -}; - -#define DRM_AGP_GET _drm_agp_get() -#define DRM_AGP_PUT _drm_agp_put() - -static drm_agp_t *_drm_agp_get(void) -{ - drm_agp_fill_t *fill; - int agp_available = 1; - - for (fill = &drm_agp_fill[0]; fill->name; fill++) { - char *n = (char *)fill->name; - *fill->f = (drm_agp_func_u)get_module_symbol(NULL, n); - DRM_DEBUG("%s resolves to 0x%08lx\n", n, (*fill->f).address); - if (!(*fill->f).address) agp_available = 0; - } - return &drm_agp_struct; -} - -static void _drm_agp_put(void) -{ - drm_agp_fill_t *fill; - - for (fill = &drm_agp_fill[0]; fill->name; fill++) { -#if LINUX_VERSION_CODE >= 0x020400 - if ((*fill->f).address) put_module_symbol((*fill->f).address); -#endif - (*fill->f).address = 0; - } -} -#endif diff --git a/linux/ati_pcigart.h b/linux/ati_pcigart.h index a794b3e0..d5d7c0ad 100644 --- a/linux/ati_pcigart.h +++ b/linux/ati_pcigart.h @@ -103,7 +103,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, goto done; } -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) if ( !dev->pdev ) { DRM_ERROR( "PCI device unknown!\n" ); goto done; @@ -130,7 +130,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev, memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) ); for ( i = 0 ; i < pages ; i++ ) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) /* we need to support large memory configurations */ entry->busaddr[i] = pci_map_single(dev->pdev, page_address( entry->pagelist[i] ), @@ -171,7 +171,7 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev, unsigned long addr, dma_addr_t bus_addr) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) drm_sg_mem_t *entry = dev->sg; unsigned long pages; int i; diff --git a/linux/compat-pre24.h b/linux/compat-pre24.h deleted file mode 100644 index 0ad96b12..00000000 --- a/linux/compat-pre24.h +++ /dev/null @@ -1,51 +0,0 @@ -/* compat-pre24.h -- Linux pre-2.4.0 compatibility - * Created: Mon Aug 28 15:31:43 2000 by faith@acm.org - * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Authors: - * Rickard E. (Rik) Faith <faith@valinux.com> - * - */ - -#ifndef _COMPAT_PRE24_H_ -#define _COMPAT_PRE24_H_ - - /* virt_to_page added in 2.4.0-test6 */ -#if LINUX_VERSION_CODE < 0x020400 -#define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr)) -#endif - -#define block_all_signals(a,b,c) -#define unblock_all_signals() - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) -#define __exit -#endif - - /* This is a hack that only works for - this code base -- because we always - call this with dev->tq.* */ -#undef INIT_LIST_HEAD -#define INIT_LIST_HEAD(pointer) dev->tq.next = NULL - -#endif diff --git a/linux/drmP.h b/linux/drmP.h index 434d5462..fdad8b42 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -406,7 +406,7 @@ typedef struct drm_sg_mem { void *virtual; int pages; struct page **pagelist; -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) dma_addr_t *busaddr; #endif } drm_sg_mem_t; diff --git a/linux/drm_agpsupport.h b/linux/drm_agpsupport.h index 66d1defc..b4b85abd 100644 --- a/linux/drm_agpsupport.h +++ b/linux/drm_agpsupport.h @@ -35,12 +35,8 @@ #if __REALLY_HAVE_AGP -#if LINUX_VERSION_CODE < 0x020400 -#include "agpsupport-pre24.h" -#else #define DRM_AGP_GET (drm_agp_t *)inter_module_get("drm_agp") #define DRM_AGP_PUT inter_module_put("drm_agp") -#endif static const drm_agp_t *drm_agp = NULL; @@ -271,22 +267,18 @@ drm_agp_head_t *DRM(agp_init)(void) case INTEL_GX: head->chipset = "Intel 440GX"; break; case INTEL_I810: head->chipset = "Intel i810"; break; -#if LINUX_VERSION_CODE >= 0x020400 case INTEL_I815: head->chipset = "Intel i815"; break; case INTEL_I840: head->chipset = "Intel i840"; break; case INTEL_I850: head->chipset = "Intel i850"; break; -#endif case VIA_GENERIC: head->chipset = "VIA"; break; case VIA_VP3: head->chipset = "VIA VP3"; break; case VIA_MVP3: head->chipset = "VIA MVP3"; break; -#if LINUX_VERSION_CODE >= 0x020400 case VIA_MVP4: head->chipset = "VIA MVP4"; break; case VIA_APOLLO_KX133: head->chipset = "VIA Apollo KX133"; break; case VIA_APOLLO_KT133: head->chipset = "VIA Apollo KT133"; break; -#endif case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro"; break; diff --git a/linux/drm_bufs.h b/linux/drm_bufs.h index 55234a01..6664d040 100644 --- a/linux/drm_bufs.h +++ b/linux/drm_bufs.h @@ -318,11 +318,7 @@ int DRM(rmmap)( DRM_OS_IOCTL ) #ifdef __linux__ for (pt = dev->vmalist, prev = NULL; pt; prev = pt, pt = pt->next) { -#if LINUX_VERSION_CODE >= 0x020300 if (pt->vma->vm_private_data == map) found_maps++; -#else - if (pt->vma->vm_pte == map) found_maps++; -#endif } #endif diff --git a/linux/drm_drv.h b/linux/drm_drv.h index 66aa05a2..72ad3191 100644 --- a/linux/drm_drv.h +++ b/linux/drm_drv.h @@ -117,7 +117,6 @@ #endif #ifndef DRIVER_FOPS #ifdef __linux__ -#if LINUX_VERSION_CODE >= 0x020400 #define DRIVER_FOPS \ static struct file_operations DRM(fops) = { \ owner: THIS_MODULE, \ @@ -130,19 +129,6 @@ static struct file_operations DRM(fops) = { \ fasync: DRM(fasync), \ poll: DRM(poll), \ } -#else -#define DRIVER_FOPS \ -static struct file_operations DRM(fops) = { \ - open: DRM(open), \ - flush: DRM(flush), \ - release: DRM(release), \ - ioctl: DRM(ioctl), \ - mmap: DRM(mmap), \ - read: DRM(read), \ - fasync: DRM(fasync), \ - poll: DRM(poll), \ -} -#endif #endif /* __linux__ */ #ifdef __FreeBSD__ #if DRM_LINUX @@ -978,11 +964,6 @@ int DRM( open)(dev_t kdev, int flags, int fmt, struct proc *p) #endif if ( !retcode ) { -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020333 - MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif -#endif atomic_inc( &dev->counts[_DRM_STAT_OPENS] ); DRM_OS_SPINLOCK( &dev->count_lock ); if ( !dev->open_count++ ) { @@ -1157,11 +1138,6 @@ int DRM( close)(dev_t kdev, int flags, int fmt, struct proc *p) * End inline drm_release */ -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif -#endif atomic_inc( &dev->counts[_DRM_STAT_CLOSES] ); DRM_OS_SPINLOCK( &dev->count_lock ); if ( !--dev->open_count ) { diff --git a/linux/drm_fops.h b/linux/drm_fops.h index d94d8811..6bd43596 100644 --- a/linux/drm_fops.h +++ b/linux/drm_fops.h @@ -299,28 +299,10 @@ int DRM(write_string)(drm_device_t *dev, const char *s) } #ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020315 && !defined(KILLFASYNCHASTHREEPARAMETERS) - /* The extra parameter to kill_fasync was added in 2.3.21, and is - _not_ present in _stock_ 2.2.14 and 2.2.15. However, some - distributions patch 2.2.x kernels to add this parameter. The - Makefile.linux attempts to detect this addition and defines - KILLFASYNCHASTHREEPARAMETERS if three parameters are found. */ - if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO); -#else - - /* Parameter added in 2.3.21. */ -#if LINUX_VERSION_CODE < 0x020400 - if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN); -#else - /* Type of first parameter changed in - Linux 2.4.0-test2... */ if (dev->buf_async) kill_fasync(&dev->buf_async, SIGIO, POLL_IN); -#endif -#endif DRM_DEBUG("waking\n"); wake_up_interruptible(&dev->buf_readers); #endif - #ifdef __FreeBSD__ if (dev->buf_selecting) { dev->buf_selecting = 0; diff --git a/linux/drm_memory.h b/linux/drm_memory.h index 24f59ae5..8619c345 100644 --- a/linux/drm_memory.h +++ b/linux/drm_memory.h @@ -115,13 +115,8 @@ void DRM(mem_init)(void) #ifdef __linux__ si_meminfo(&si); -#if LINUX_VERSION_CODE < 0x020317 - /* Changed to page count in 2.3.23 */ - DRM(ram_available) = si.totalram >> PAGE_SHIFT; -#else DRM(ram_available) = si.totalram; #endif -#endif #ifdef __FreeBSD__ DRM(ram_available) = 0; /* si.totalram */ #endif @@ -359,12 +354,7 @@ unsigned long DRM(alloc_pages)(int order, int area) for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { -#if LINUX_VERSION_CODE >= 0x020400 - /* Argument type changed in 2.4.0-test6/pre8 */ mem_map_reserve(virt_to_page(addr)); -#else - mem_map_reserve(MAP_NR(addr)); -#endif } #endif @@ -387,12 +377,7 @@ void DRM(free_pages)(unsigned long address, int order, int area) for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { -#if LINUX_VERSION_CODE >= 0x020400 - /* Argument type changed in 2.4.0-test6/pre8 */ mem_map_unreserve(virt_to_page(addr)); -#else - mem_map_unreserve(MAP_NR(addr)); -#endif } free_pages(address, order); #endif diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h index 55a7a3cd..ffae2c08 100644 --- a/linux/drm_os_linux.h +++ b/linux/drm_os_linux.h @@ -31,13 +31,8 @@ #include <linux/types.h> #include <linux/agp_backend.h> #endif -#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ #include <linux/tqueue.h> #include <linux/poll.h> -#endif -#if LINUX_VERSION_CODE < 0x020400 -#include "compat-pre24.h" -#endif #include <asm/pgalloc.h> #include "drm.h" @@ -60,12 +55,7 @@ typedef struct wait_queue *wait_queue_head_t; #define _PAGE_PSE _PAGE_4M #endif - /* vm_offset changed to vm_pgoff in 2.3.25 */ -#if LINUX_VERSION_CODE < 0x020319 -#define VM_OFFSET(vma) ((vma)->vm_offset) -#else #define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT) -#endif /* *_nopage return values defined in 2.3.26 */ #ifndef NOPAGE_SIGBUS @@ -361,21 +351,6 @@ extern int DRM(mapbufs)( DRM_OS_IOCTL ); #endif /* Mapping support (drm_vm.h) */ -#if LINUX_VERSION_CODE < 0x020317 -extern unsigned long DRM(vm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -extern unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access); -#else - /* Return type changed in 2.3.23 */ extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access); @@ -388,7 +363,6 @@ extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access); -#endif extern void DRM(vm_open)(struct vm_area_struct *vma); extern void DRM(vm_close)(struct vm_area_struct *vma); extern void DRM(vm_shm_close)(struct vm_area_struct *vma); diff --git a/linux/drm_scatter.h b/linux/drm_scatter.h index 66d34968..f0074450 100644 --- a/linux/drm_scatter.h +++ b/linux/drm_scatter.h @@ -47,7 +47,7 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry ) vfree( entry->virtual ); -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); @@ -99,7 +99,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, return -ENOMEM; } -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); if ( !entry->busaddr ) { @@ -116,7 +116,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); if ( !entry->virtual ) { -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); diff --git a/linux/drm_stub.h b/linux/drm_stub.h index 80bdac61..ead5b959 100644 --- a/linux/drm_stub.h +++ b/linux/drm_stub.h @@ -31,12 +31,6 @@ #define __NO_VERSION__ #include "drmP.h" -#ifdef __linux__ -#if LINUX_VERSION_CODE < 0x020400 -#include "stubsupport-pre24.h" -#endif -#endif - #define DRM_STUB_MAXCARDS 16 /* Enough for one machine */ static struct drm_stub_list { @@ -72,9 +66,7 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp) } static struct file_operations DRM(stub_fops) = { -#if LINUX_VERSION_CODE >= 0x020400 owner: THIS_MODULE, -#endif open: DRM(stub_open) }; diff --git a/linux/drm_vm.h b/linux/drm_vm.h index b5a5deb6..f01d2081 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -56,16 +56,9 @@ struct vm_operations_struct DRM(vm_sg_ops) = { close: DRM(vm_close), }; -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { #if defined(__alpha__) && __REALLY_HAVE_AGP drm_file_t *priv = vma->vm_file->private_data; @@ -122,32 +115,17 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma, baddr, __va(agpmem->memory->memory[offset]), offset); #endif get_page(page); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } #endif return NOPAGE_SIGBUS; /* Disallow mremap */ } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { -#if LINUX_VERSION_CODE >= 0x020300 drm_map_t *map = (drm_map_t *)vma->vm_private_data; -#else - drm_map_t *map = (drm_map_t *)vma->vm_pte; -#endif unsigned long offset; unsigned long i; pgd_t *pgd; @@ -174,11 +152,7 @@ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma, get_page(page); DRM_DEBUG("0x%08lx => 0x%08x\n", address, page_to_bus(page)); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } /* Special close routine which deletes map information if we are the last @@ -197,25 +171,14 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif atomic_dec(&dev->vma_count); -#if LINUX_VERSION_CODE >= 0x020300 map = vma->vm_private_data; -#else - map = vma->vm_pte; -#endif down(&dev->struct_sem); for (pt = dev->vmalist, prev = NULL; pt; pt = next) { next = pt->next; -#if LINUX_VERSION_CODE >= 0x020300 if (pt->vma->vm_private_data == map) found_maps++; -#else - if (pt->vma->vm_pte == map) found_maps++; -#endif if (pt->vma == vma) { if (prev) { prev->next = pt->next; @@ -268,16 +231,9 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) up(&dev->struct_sem); } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { drm_file_t *priv = vma->vm_file->private_data; drm_device_t *dev = priv->dev; @@ -299,29 +255,14 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, DRM_DEBUG("0x%08lx (page %lu) => 0x%08x\n", address, page_nr, page_to_bus(page)); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } -#if LINUX_VERSION_CODE < 0x020317 -unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma, - unsigned long address, - int write_access) -#else - /* Return type changed in 2.3.23 */ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, unsigned long address, int write_access) -#endif { -#if LINUX_VERSION_CODE >= 0x020300 drm_map_t *map = (drm_map_t *)vma->vm_private_data; -#else - drm_map_t *map = (drm_map_t *)vma->vm_pte; -#endif drm_file_t *priv = vma->vm_file->private_data; drm_device_t *dev = priv->dev; drm_sg_mem_t *entry = dev->sg; @@ -341,11 +282,7 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, page = entry->pagelist[page_offset]; get_page(page); -#if LINUX_VERSION_CODE < 0x020317 - return page_address(page); -#else return page; -#endif } void DRM(vm_open)(struct vm_area_struct *vma) @@ -357,10 +294,6 @@ void DRM(vm_open)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); atomic_inc(&dev->vma_count); -#if LINUX_VERSION_CODE < 0x020333 - /* The map can exist after the fd is closed. */ - MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif vma_entry = DRM(alloc)(sizeof(*vma_entry), DRM_MEM_VMAS); if (vma_entry) { @@ -381,9 +314,6 @@ void DRM(vm_close)(struct vm_area_struct *vma) DRM_DEBUG("0x%08lx,0x%08lx\n", vma->vm_start, vma->vm_end - vma->vm_start); -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif atomic_dec(&dev->vma_count); down(&dev->struct_sem); @@ -424,11 +354,6 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma) vma->vm_ops = &DRM(vm_dma_ops); vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ -#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */ - /* In Linux 2.2.3 and above, this is - handled in do_mmap() in mm/mmap.c. */ - ++filp->f_count; -#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); return 0; @@ -543,22 +468,14 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) break; case _DRM_SHM: vma->vm_ops = &DRM(vm_shm_ops); -#if LINUX_VERSION_CODE >= 0x020300 vma->vm_private_data = (void *)map; -#else - vma->vm_pte = (unsigned long)map; -#endif /* Don't let this area swap. Change when DRM_KERNEL advisory is supported. */ vma->vm_flags |= VM_LOCKED; break; case _DRM_SCATTER_GATHER: vma->vm_ops = &DRM(vm_sg_ops); -#if LINUX_VERSION_CODE >= 0x020300 vma->vm_private_data = (void *)map; -#else - vma->vm_pte = (unsigned long)map; -#endif vma->vm_flags |= VM_LOCKED; break; default: @@ -566,11 +483,6 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) } vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ -#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */ - /* In Linux 2.2.3 and above, this is - handled in do_mmap() in mm/mmap.c. */ - ++filp->f_count; -#endif vma->vm_file = filp; /* Needed for drm_vm_open() */ DRM(vm_open)(vma); return 0; diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 1ab8b930..a85d9b45 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -231,14 +231,9 @@ static int i810_unmap_buffer(drm_buf_t *buf) #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); -#else retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, (size_t) buf->total); -#endif #if LINUX_VERSION_CODE <= 0x020402 up( ¤t->mm->mmap_sem ); #else diff --git a/linux/r128_cce.c b/linux/r128_cce.c index 05404aa8..a34fba0e 100644 --- a/linux/r128_cce.c +++ b/linux/r128_cce.c @@ -361,7 +361,7 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev, tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; page_ofs = tmp_ofs >> PAGE_SHIFT; -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, entry->busaddr[page_ofs]); DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", diff --git a/linux/radeon_cp.c b/linux/radeon_cp.c index 842d65fe..2e4961cb 100644 --- a/linux/radeon_cp.c +++ b/linux/radeon_cp.c @@ -635,7 +635,7 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; page_ofs = tmp_ofs >> PAGE_SHIFT; -#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400) +#if defined(__alpha__) RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", diff --git a/linux/stubsupport-pre24.h b/linux/stubsupport-pre24.h deleted file mode 100644 index f5046f7f..00000000 --- a/linux/stubsupport-pre24.h +++ /dev/null @@ -1,44 +0,0 @@ -/* stubsupport.h -- -*- linux-c -*- - * Created: Fri Jan 19 10:48:35 2001 by faith@acm.org - * - * Copyright 2001 VA Linux Systems, Inc., Sunnyvale, California. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Authors: - * Rickard E. (Rik) Faith <faith@valinux.com> - * - */ - -#ifndef _STUBSUPPORT_PRE24_H_ -#define _STUBSUPPORT_PRE24_H_ -struct drm_stub_info *DRM(_stub_pointer) = NULL; -#define inter_module_put(x) -#define inter_module_unregister(x) -#define inter_module_get(x) DRM(_stub_pointer) -#define inter_module_register(x,y,z) do { DRM(_stub_pointer) = z; } while (0) - - /* This is a kludge for backward compatibility - that is only useful in DRM(stub_open) */ -#define fops_put(fops) MOD_DEC_USE_COUNT -#define fops_get(fops) (fops); MOD_INC_USE_COUNT - -#endif |