WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Eliminate kernel version checks from x86_64/kernel/p

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Eliminate kernel version checks from x86_64/kernel/pci-dma.c
From: Chris Wright <chrisw@xxxxxxxx>
Date: Fri, 15 Apr 2005 14:30:30 -0700
Delivery-date: Fri, 15 Apr 2005 21:30:31 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
Eliminate kernel version checks from x86_64/kernel/pci-dma.c as a trivial
first pass cleanup towards merging.

Signed-off-by: Chris Wright <chrisw@xxxxxxxx>
---

 linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c |   27 ---------------
 1 files changed, 27 deletions(-)

===== linux-2.6.11-xen-sparse/arch/x86_64/kernel/pci-dma.c 1.3 vs edited =====
--- 1.3/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c        
2005-04-06 01:37:08 -07:00
+++ edited/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c     
2005-04-15 11:13:20 -07:00
@@ -10,12 +10,6 @@
 #include <asm/io.h>
 #include <asm-xen/balloon.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#define pte_offset_kernel pte_offset
-#define pud_t pgd_t
-#define pud_offset(d, va) d
-#endif
-
 /* Map a set of buffers described by scatterlist in streaming
  * mode for DMA.  This is the scatter-gather version of the
  * above pci_map_single interface.  Here the scatter gather list
@@ -125,24 +119,13 @@ xen_contig_memory(unsigned long vstart, 
         balloon_unlock(flags);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-                          dma_addr_t *dma_handle)
-#else
 void *dma_alloc_coherent(struct device *dev, size_t size,
                           dma_addr_t *dma_handle, unsigned gfp)
-#endif
 {
        void *ret;
        unsigned int order = get_order(size);
        unsigned long vstart;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-       int gfp = GFP_ATOMIC;
-
-       if (hwdev == NULL || ((u32)hwdev->dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
-#else
        struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 
        /* ignore region specifiers */
@@ -163,7 +146,6 @@ void *dma_alloc_coherent(struct device *
 
        if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
                gfp |= GFP_DMA;
-#endif
 
        vstart = __get_free_pages(gfp, order);
        ret = (void *)vstart;
@@ -179,14 +161,6 @@ void *dma_alloc_coherent(struct device *
 }
 EXPORT_SYMBOL(dma_alloc_coherent);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-                        void *vaddr, dma_addr_t dma_handle)
-{
-       free_pages((unsigned long)vaddr, get_order(size));
-}
-#else
-
 void dma_free_coherent(struct device *dev, size_t size,
                         void *vaddr, dma_addr_t dma_handle)
 {
@@ -279,5 +253,4 @@ void *dma_mark_declared_memory_occupied(
        return mem->virt_base + (pos << PAGE_SHIFT);
 }
 EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
-#endif
 #endif

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Eliminate kernel version checks from x86_64/kernel/pci-dma.c, Chris Wright <=