ia64/xen-unstable

changeset 2733:b5c439563b62

bitkeeper revision 1.1159.1.275 (417d602cyKuqblSyKliOgatz5hdcRw)

Fix 2.4.x build after 2.6.9 upgrade.
author cl349@freefall.cl.cam.ac.uk
date Mon Oct 25 20:21:00 2004 +0000 (2004-10-25)
parents 38c3276d3022
children e179120c0693
files .bk-to-hg .hg-to-bk .rootkeys linux-2.4.27-xen-sparse/mkbuildtree linux-2.6.9-xen-sparse/arch/xen/i386/kernel/pci-dma.c
line diff
     1.1 --- a/.bk-to-hg	Mon Oct 25 20:00:58 2004 +0000
     1.2 +++ b/.bk-to-hg	Mon Oct 25 20:21:00 2004 +0000
     1.3 @@ -1,6 +1,2 @@
     1.4 -#!/bin/sh -x
     1.5 -set -e
     1.6 -test -L linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c
     1.7 -rm      linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c
     1.8 -(find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
     1.9 +#!/bin/sh
    1.10  exit 0
     2.1 --- a/.hg-to-bk	Mon Oct 25 20:00:58 2004 +0000
     2.2 +++ b/.hg-to-bk	Mon Oct 25 20:21:00 2004 +0000
     2.3 @@ -1,10 +1,2 @@
     2.4 -#!/bin/sh -x
     2.5 -set -e
     2.6 -mkdir -p linux-2.4.27-xen-sparse
     2.7 -mkdir -p linux-2.4.27-xen-sparse/arch
     2.8 -mkdir -p linux-2.4.27-xen-sparse/arch/xen
     2.9 -mkdir -p linux-2.4.27-xen-sparse/arch/xen/drivers
    2.10 -mkdir -p linux-2.4.27-xen-sparse/arch/xen/drivers/balloon
    2.11 -ln -s ../../../../../linux-2.6.8.1-xen-sparse/drivers/xen/balloon/balloon.c linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c
    2.12 -(find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
    2.13 +#!/bin/sh
    2.14  exit 0
     3.1 --- a/.rootkeys	Mon Oct 25 20:00:58 2004 +0000
     3.2 +++ b/.rootkeys	Mon Oct 25 20:21:00 2004 +0000
     3.3 @@ -47,7 +47,6 @@ 3e5a4e65OV_j_DBtjzt5vej771AJsA linux-2.4
     3.4  40648526SxcA4lGIHB_k7ID8VlRSzw linux-2.4.27-xen-sparse/arch/xen/defconfig-xen0
     3.5  40c73c77QesbL7eIvG-fJGAtVwhGRg linux-2.4.27-xen-sparse/arch/xen/defconfig-xenU
     3.6  3e6377f5xwPfYZkPHPrDbEq1PRN7uQ linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/Makefile
     3.7 -4177c0c3ju-Bo3TJaQHh4fOsy06UgQ linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c
     3.8  4083dc16z0jvZEH4PiVDbDRreaNp6w linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/Makefile
     3.9  4083dc16KQus88a4U3uCV6qVCA6_8Q linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/backend/Makefile
    3.10  4075806dI5kfeMD5RV-DA0PYoThx_w linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile
     4.1 --- a/linux-2.4.27-xen-sparse/mkbuildtree	Mon Oct 25 20:00:58 2004 +0000
     4.2 +++ b/linux-2.4.27-xen-sparse/mkbuildtree	Mon Oct 25 20:21:00 2004 +0000
     4.3 @@ -247,6 +247,9 @@ ln -sf ../../i386/mm/extable.c
     4.4  ln -sf ../../i386/mm/pageattr.c 
     4.5  ln -sf ../../../${LINUX_26}/arch/xen/i386/mm/hypervisor.c
     4.6  
     4.7 +cd ${AD}/arch/xen/drivers/balloon
     4.8 +ln -sf ../../../../${LINUX_26}/drivers/xen/balloon/balloon.c
     4.9 +
    4.10  cd ${AD}/arch/xen/drivers/console
    4.11  ln -sf ../../../../${LINUX_26}/drivers/xen/console/console.c 
    4.12  
     5.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Mon Oct 25 20:00:58 2004 +0000
     5.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Mon Oct 25 20:21:00 2004 +0000
     5.3 @@ -14,6 +14,10 @@
     5.4  #include <linux/version.h>
     5.5  #include <asm/io.h>
     5.6  
     5.7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
     5.8 +#define pte_offset_kernel pte_offset
     5.9 +#endif
    5.10 +
    5.11  struct dma_coherent_mem {
    5.12  	void		*virt_base;
    5.13  	u32		device_base;
    5.14 @@ -22,8 +26,8 @@ struct dma_coherent_mem {
    5.15  	unsigned long	*bitmap;
    5.16  };
    5.17  
    5.18 -void
    5.19 -dma_contig_memory(unsigned long vstart, unsigned int order)
    5.20 +static void
    5.21 +xen_contig_memory(unsigned long vstart, unsigned int order)
    5.22  {
    5.23  	/*
    5.24  	 * Ensure multi-page extents are contiguous in machine memory.
    5.25 @@ -69,7 +73,6 @@ dma_contig_memory(unsigned long vstart, 
    5.26  }
    5.27  
    5.28  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    5.29 -#define pte_offset_kernel pte_offset
    5.30  void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
    5.31  			   dma_addr_t *dma_handle)
    5.32  #else
    5.33 @@ -114,7 +117,7 @@ void *dma_alloc_coherent(struct device *
    5.34  	if (ret == NULL)
    5.35  		return ret;
    5.36  
    5.37 -	dma_contig_memory(vstart, order);
    5.38 +	xen_contig_memory(vstart, order);
    5.39  
    5.40  	memset(ret, 0, size);
    5.41  	*dma_handle = virt_to_bus(ret);
    5.42 @@ -125,10 +128,13 @@ void *dma_alloc_coherent(struct device *
    5.43  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    5.44  void pci_free_consistent(struct pci_dev *hwdev, size_t size,
    5.45  			 void *vaddr, dma_addr_t dma_handle)
    5.46 +{
    5.47 +	free_pages((unsigned long)vaddr, get_order(size));
    5.48 +}
    5.49  #else
    5.50 +
    5.51  void dma_free_coherent(struct device *dev, size_t size,
    5.52  			 void *vaddr, dma_addr_t dma_handle)
    5.53 -#endif
    5.54  {
    5.55  	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
    5.56  	int order = get_order(size);
    5.57 @@ -216,3 +222,5 @@ void *dma_mark_declared_memory_occupied(
    5.58  	return mem->virt_base + (pos << PAGE_SHIFT);
    5.59  }
    5.60  EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
    5.61 +
    5.62 +#endif