Merge ../linus
[linux-drm-fsl-dcu.git] / arch / arm / mm / mmap.c
index 3de7f84b53c25e3cdd5f8d44da252336fb55645a..b0b5f46940705431a468efb6681a7636e40e988e 100644 (file)
@@ -1,7 +1,6 @@
 /*
  *  linux/arch/arm/mm/mmap.c
  */
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -115,3 +114,25 @@ full_search:
        }
 }
 
+
+/*
+ * You really shouldn't be using read() or write() on /dev/mem.  This
+ * might go away in the future.
+ */
+int valid_phys_addr_range(unsigned long addr, size_t size)
+{
+       if (addr + size > __pa(high_memory))
+               return 0;
+
+       return 1;
+}
+
+/*
+ * We don't use supersection mappings for mmap() on /dev/mem, which
+ * means that we can't map the memory area above the 4G barrier into
+ * userspace.
+ */
+int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
+{
+       return !(pfn + (size >> PAGE_SHIFT) > 0x00100000);
+}