ia64/xen-unstable

changeset 3250:63bb7af323c9

bitkeeper revision 1.1159.170.58 (41b4bb00jD0BIt8SvQ2huMfxtlNGFg)

Cset exclude: iap10@labyrinth.cl.cam.ac.uk|ChangeSet|20041205190407|24206
author cl349@arcadians.cl.cam.ac.uk
date Mon Dec 06 20:03:12 2004 +0000 (2004-12-06)
parents 2dfba7f4548c
children a169836882cb
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	Mon Dec 06 19:30:12 2004 +0000
     1.2 +++ b/linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c	Mon Dec 06 20:03:12 2004 +0000
     1.3 @@ -42,7 +42,12 @@ extern void tapechar_init(void);
     1.4   */
     1.5  static inline int uncached_access(struct file *file, unsigned long addr)
     1.6  {
     1.7 -#if defined(__i386__)
     1.8 +#ifdef CONFIG_XEN
     1.9 +	if (file->f_flags & O_SYNC)
    1.10 +		return 1;
    1.11 +	/* Xen sets correct MTRR type on non-RAM for us. */
    1.12 +	return 0;
    1.13 +#elif 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 @@ -201,20 +206,21 @@ 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(__sparc__)
    1.22 -	if (io_remap_page_range(vma,
    1.23 -				vma->vm_start,
    1.24 -				vma->vm_pgoff << PAGE_SHIFT,
    1.25 -				vma->vm_end-vma->vm_start,
    1.26 -				vma->vm_page_prot, 0))
    1.27 -		return -EAGAIN;
    1.28 -#else
    1.29 +#if defined(CONFIG_XEN)
    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  }