[ARM] cputype: separate definitions, use them
[deliverable/linux.git] / arch / arm / mm / mmap.c
index b0b5f46940705431a468efb6681a7636e40e988e..28ead8393b5ac30594a023fe102ec19fabfceeb9 100644 (file)
@@ -5,7 +5,8 @@
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/shm.h>
-
+#include <linux/sched.h>
+#include <asm/cputype.h>
 #include <asm/system.h>
 
 #define COLOUR_ALIGN(addr,pgoff)               \
@@ -37,8 +38,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
         * caches alias.  This is indicated by bits 9 and 21 of the
         * cache type register.
         */
-       cache_type = read_cpuid(CPUID_CACHETYPE);
-       if (cache_type != read_cpuid(CPUID_ID)) {
+       cache_type = read_cpuid_cachetype();
+       if (cache_type != read_cpuid_id()) {
                aliasing = (cache_type | cache_type >> 12) & (1 << 11);
                if (aliasing)
                        do_align = filp || flags & MAP_SHARED;
@@ -49,8 +50,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 #endif
 
        /*
-        * We should enforce the MAP_FIXED case.  However, currently
-        * the generic kernel code doesn't allow us to handle this.
+        * We enforce the MAP_FIXED case.
         */
        if (flags & MAP_FIXED) {
                if (aliasing && flags & MAP_SHARED && addr & (SHMLBA - 1))
@@ -121,6 +121,8 @@ full_search:
  */
 int valid_phys_addr_range(unsigned long addr, size_t size)
 {
+       if (addr < PHYS_OFFSET)
+               return 0;
        if (addr + size > __pa(high_memory))
                return 0;
 
This page took 0.035568 seconds and 5 git commands to generate.