- patches.arch/x86_mce_intel_decode_physical_address.patch:
[linux-flexiantxendom0-3.2.10.git] / drivers / char / mem.c
index 890a51a..31a8b1f 100644 (file)
@@ -89,7 +89,6 @@ void __weak unxlate_dev_mem_ptr(unsigned long phys, void *addr)
 {
 }
 
-#ifndef ARCH_HAS_DEV_MEM
 /*
  * This funcion reads the *physical* memory. The f_pos points directly to the
  * memory location.
@@ -212,7 +211,6 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
        *ppos += written;
        return written;
 }
-#endif
 
 int __weak phys_mem_access_prot_allowed(struct file *file,
        unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
@@ -339,9 +337,6 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
 static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
 {
        unsigned long pfn;
-#ifdef CONFIG_XEN
-       unsigned long i, count;
-#endif
 
        /* Turn a kernel-virtual address into a physical page frame */
        pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT;
@@ -356,13 +351,6 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
        if (!pfn_valid(pfn))
                return -EIO;
 
-#ifdef CONFIG_XEN
-       count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-       for (i = 0; i < count; i++)
-               if ((pfn + i) != mfn_to_local_pfn(pfn_to_mfn(pfn + i)))
-                       return -EIO;
-#endif
-
        vma->vm_pgoff = pfn;
        return mmap_mem(file, vma);
 }
@@ -857,7 +845,6 @@ static int open_port(struct inode * inode, struct file * filp)
 #define open_kmem      open_mem
 #define open_oldmem    open_mem
 
-#ifndef ARCH_HAS_DEV_MEM
 static const struct file_operations mem_fops = {
        .llseek         = memory_lseek,
        .read           = read_mem,
@@ -866,9 +853,6 @@ static const struct file_operations mem_fops = {
        .open           = open_mem,
        .get_unmapped_area = get_unmapped_area_mem,
 };
-#else
-extern const struct file_operations mem_fops;
-#endif
 
 #ifdef CONFIG_DEVKMEM
 static const struct file_operations kmem_fops = {