Don't (re)define vmalloc_to_page for kernel >= 2.4.19, as it has been
authorLeif Delgass <ldelgass@users.sourceforge.net>
Thu, 22 Aug 2002 19:35:31 +0000 (19:35 +0000)
committerLeif Delgass <ldelgass@users.sourceforge.net>
Thu, 22 Aug 2002 19:35:31 +0000 (19:35 +0000)
    backported from 2.5.x. Also fix a couple of incorrect
    LINUX_VERSION_CODE tests and fix header dependency for r128, radeon
    when building without AGP.

linux-core/drmP.h
linux-core/drm_agpsupport.c
linux-core/drm_vm.c
linux/Makefile.linux
linux/drmP.h
linux/drm_agpsupport.h
linux/drm_vm.h

index c00efb4..f31c5c3 100644 (file)
 #define pte_unmap(pte)
 #endif
 
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020413 /* KERNEL_VERSION(2,4,19) */
 static inline struct page * vmalloc_to_page(void * vmalloc_addr)
 {
        unsigned long addr = (unsigned long) vmalloc_addr;
index fc0b29a..cd46110 100644 (file)
@@ -268,11 +268,11 @@ drm_agp_head_t *DRM(agp_init)(void)
                case INTEL_I810:        head->chipset = "Intel i810";    break;
 
                case INTEL_I815:        head->chipset = "Intel i815";    break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
                case INTEL_I820:        head->chipset = "Intel i820";    break;
 #endif
                case INTEL_I840:        head->chipset = "Intel i840";    break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
                case INTEL_I845:        head->chipset = "Intel i845";    break;
 #endif
                case INTEL_I850:        head->chipset = "Intel i850";    break;
index 49ce309..52dfd59 100644 (file)
@@ -343,7 +343,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
 
        vma->vm_ops   = &DRM(vm_dma_ops);
 
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
        vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
 #else
        vma->vm_flags |= VM_RESERVED; /* Don't swap */
@@ -473,7 +473,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
                vma->vm_private_data = (void *)map;
                                /* Don't let this area swap.  Change when
                                   DRM_KERNEL advisory is supported. */
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
                vma->vm_flags |= VM_LOCKED;
 #else
                vma->vm_flags |= VM_RESERVED;
@@ -482,7 +482,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        case _DRM_SCATTER_GATHER:
                vma->vm_ops = &DRM(vm_sg_ops);
                vma->vm_private_data = (void *)map;
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
                vma->vm_flags |= VM_LOCKED;
 #else
                vma->vm_flags |= VM_RESERVED;
@@ -491,7 +491,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        default:
                return -EINVAL; /* This should never happen. */
        }
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
        vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
 #else
        vma->vm_flags |= VM_RESERVED; /* Don't swap */
index 893d498..a8cd62a 100644 (file)
@@ -254,12 +254,12 @@ ChangeLog:
 
 $(GAMMAOBJS): $(GAMMAHEADERS)
 $(TDFXOBJS): $(TDFXHEADERS)
+$(R128OBJS): $(R128HEADERS)
+$(RADEONOBJS): $(RADEONHEADERS)
 ifeq ($(AGP),1)
 $(MGAOBJS): $(MGAHEADERS)
 $(I810OBJS): $(I810HEADERS)
 $(I830OBJS): $(I830HEADERS)
-$(R128OBJS): $(R128HEADERS)
-$(RADEONOBJS): $(RADEONHEADERS)
 endif
 
 clean cleandir::
index c00efb4..f31c5c3 100644 (file)
 #define pte_unmap(pte)
 #endif
 
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020413 /* KERNEL_VERSION(2,4,19) */
 static inline struct page * vmalloc_to_page(void * vmalloc_addr)
 {
        unsigned long addr = (unsigned long) vmalloc_addr;
index fc0b29a..cd46110 100644 (file)
@@ -268,11 +268,11 @@ drm_agp_head_t *DRM(agp_init)(void)
                case INTEL_I810:        head->chipset = "Intel i810";    break;
 
                case INTEL_I815:        head->chipset = "Intel i815";    break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
                case INTEL_I820:        head->chipset = "Intel i820";    break;
 #endif
                case INTEL_I840:        head->chipset = "Intel i840";    break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
                case INTEL_I845:        head->chipset = "Intel i845";    break;
 #endif
                case INTEL_I850:        head->chipset = "Intel i850";    break;
index 49ce309..52dfd59 100644 (file)
@@ -343,7 +343,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
 
        vma->vm_ops   = &DRM(vm_dma_ops);
 
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
        vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
 #else
        vma->vm_flags |= VM_RESERVED; /* Don't swap */
@@ -473,7 +473,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
                vma->vm_private_data = (void *)map;
                                /* Don't let this area swap.  Change when
                                   DRM_KERNEL advisory is supported. */
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
                vma->vm_flags |= VM_LOCKED;
 #else
                vma->vm_flags |= VM_RESERVED;
@@ -482,7 +482,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        case _DRM_SCATTER_GATHER:
                vma->vm_ops = &DRM(vm_sg_ops);
                vma->vm_private_data = (void *)map;
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
                vma->vm_flags |= VM_LOCKED;
 #else
                vma->vm_flags |= VM_RESERVED;
@@ -491,7 +491,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        default:
                return -EINVAL; /* This should never happen. */
        }
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
        vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
 #else
        vma->vm_flags |= VM_RESERVED; /* Don't swap */