]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
bitkeeper revision 1.1159.202.2 (41b35ba7ESi-KakWZHP4C9MhYX61Sw)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Sun, 5 Dec 2004 19:04:07 +0000 (19:04 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Sun, 5 Dec 2004 19:04:07 +0000 (19:04 +0000)
Cleanup xen-specific

linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c

index d6973d3c315f7eb5a1f0c42011296f5917abe238..49e94cac9879cb38bbed40f58b50246009710f69 100644 (file)
@@ -42,12 +42,7 @@ extern void tapechar_init(void);
  */
 static inline int uncached_access(struct file *file, unsigned long addr)
 {
-#ifdef CONFIG_XEN
-       if (file->f_flags & O_SYNC)
-               return 1;
-       /* Xen sets correct MTRR type on non-RAM for us. */
-       return 0;
-#elif defined(__i386__)
+#if defined(__i386__)
        /*
         * On the PPro and successors, the MTRRs are used to set
         * memory types for physical addresses outside main memory,
@@ -206,20 +201,19 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
                vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
 
-#if defined(CONFIG_XEN)
+#if defined(__sparc__)
        if (io_remap_page_range(vma,
                                vma->vm_start,
                                vma->vm_pgoff << PAGE_SHIFT,
                                vma->vm_end-vma->vm_start,
-                               vma->vm_page_prot))
+                               vma->vm_page_prot, 0))
                return -EAGAIN;
 #else
-       /* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */
-       if (remap_pfn_range(vma,
-                           vma->vm_start,
-                           vma->vm_pgoff,
-                           vma->vm_end-vma->vm_start,
-                           vma->vm_page_prot))
+       if (io_remap_page_range(vma,
+                               vma->vm_start,
+                               vma->vm_pgoff << PAGE_SHIFT,
+                               vma->vm_end-vma->vm_start,
+                               vma->vm_page_prot))
                return -EAGAIN;
 #endif
        return 0;