ia64/xen-unstable

changeset 3247:93b5b19706c0

bitkeeper revision 1.1159.202.2 (41b35ba7ESi-KakWZHP4C9MhYX61Sw)

Cleanup xen-specific
author iap10@labyrinth.cl.cam.ac.uk
date Sun Dec 05 19:04:07 2004 +0000 (2004-12-05)
parents 7506c6d5d303
children 2dfba7f4548c
files linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c
line diff
     1.1 --- a/linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c	Tue Nov 30 00:49:54 2004 +0000
     1.2 +++ b/linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c	Sun Dec 05 19:04:07 2004 +0000
     1.3 @@ -42,12 +42,7 @@ extern void tapechar_init(void);
     1.4   */
     1.5  static inline int uncached_access(struct file *file, unsigned long addr)
     1.6  {
     1.7 -#ifdef CONFIG_XEN
     1.8 -	if (file->f_flags & O_SYNC)
     1.9 -		return 1;
    1.10 -	/* Xen sets correct MTRR type on non-RAM for us. */
    1.11 -	return 0;
    1.12 -#elif defined(__i386__)
    1.13 +#if defined(__i386__)
    1.14  	/*
    1.15  	 * On the PPro and successors, the MTRRs are used to set
    1.16  	 * memory types for physical addresses outside main memory,
    1.17 @@ -206,21 +201,20 @@ static int mmap_mem(struct file * file, 
    1.18  		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
    1.19  #endif
    1.20  
    1.21 -#if defined(CONFIG_XEN)
    1.22 +#if defined(__sparc__)
    1.23 +	if (io_remap_page_range(vma,
    1.24 +				vma->vm_start,
    1.25 +				vma->vm_pgoff << PAGE_SHIFT,
    1.26 +				vma->vm_end-vma->vm_start,
    1.27 +				vma->vm_page_prot, 0))
    1.28 +		return -EAGAIN;
    1.29 +#else
    1.30  	if (io_remap_page_range(vma,
    1.31  				vma->vm_start,
    1.32  				vma->vm_pgoff << PAGE_SHIFT,
    1.33  				vma->vm_end-vma->vm_start,
    1.34  				vma->vm_page_prot))
    1.35  		return -EAGAIN;
    1.36 -#else
    1.37 -	/* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */
    1.38 -	if (remap_pfn_range(vma,
    1.39 -			    vma->vm_start,
    1.40 -			    vma->vm_pgoff,
    1.41 -			    vma->vm_end-vma->vm_start,
    1.42 -			    vma->vm_page_prot))
    1.43 -		return -EAGAIN;
    1.44  #endif
    1.45  	return 0;
    1.46  }