ia64/xen-unstable

changeset 13962:5abf33a383cf

[IA64] Paravirtualize mmap handlers of /proc/bus/pci

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author awilliam@xenbuild2.aw
date Sun Feb 18 16:00:52 2007 -0700 (2007-02-18)
parents 5ad7d9b466ee
children 54247a642f5e
files linux-2.6-xen-sparse/arch/ia64/pci/pci.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/pci/pci.c	Sun Feb 18 15:57:38 2007 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/pci/pci.c	Sun Feb 18 16:00:52 2007 -0700
     1.3 @@ -607,6 +607,14 @@ pci_mmap_page_range (struct pci_dev *dev
     1.4  	else
     1.5  		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
     1.6  
     1.7 +	if (is_initial_xendomain()) {
     1.8 +		unsigned long addr = vma->vm_pgoff << PAGE_SHIFT;
     1.9 +		size_t size = vma->vm_end - vma->vm_start;
    1.10 +		unsigned long offset = HYPERVISOR_ioremap(addr, size);
    1.11 +		if (IS_ERR_VALUE(offset))
    1.12 +			return offset;
    1.13 +	}
    1.14 +
    1.15  	if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
    1.16  			     vma->vm_end - vma->vm_start, vma->vm_page_prot))
    1.17  		return -EAGAIN;
    1.18 @@ -664,6 +672,14 @@ pci_mmap_legacy_page_range(struct pci_bu
    1.19  	vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT;
    1.20  	vma->vm_page_prot = prot;
    1.21  
    1.22 +	if (is_initial_xendomain()) {
    1.23 +		unsigned long addr = vma->vm_pgoff << PAGE_SHIFT;
    1.24 +		size_t size = vma->vm_end - vma->vm_start;
    1.25 +		unsigned long offset = HYPERVISOR_ioremap(addr, size);
    1.26 +		if (IS_ERR_VALUE(offset))
    1.27 +			return offset;
    1.28 +	}
    1.29 +
    1.30  	if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
    1.31  			    size, vma->vm_page_prot))
    1.32  		return -EAGAIN;