Commit 41dfaa93 authored by Rob Herring's avatar Rob Herring Committed by Russell King

ARM: 7168/1: use cache type functions for arch_get_unmapped_area

There are already cache type decoding functions, so use those instead
of custom decode code which only works for ARMv6.
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7334c675
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/random.h> #include <linux/random.h>
#include <asm/cputype.h> #include <asm/cachetype.h>
#include <asm/system.h>
#define COLOUR_ALIGN(addr,pgoff) \ #define COLOUR_ALIGN(addr,pgoff) \
((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \
...@@ -32,25 +31,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, ...@@ -32,25 +31,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
struct mm_struct *mm = current->mm; struct mm_struct *mm = current->mm;
struct vm_area_struct *vma; struct vm_area_struct *vma;
unsigned long start_addr; unsigned long start_addr;
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) int do_align = 0;
unsigned int cache_type; int aliasing = cache_is_vipt_aliasing();
int do_align = 0, aliasing = 0;
/* /*
* We only need to do colour alignment if either the I or D * We only need to do colour alignment if either the I or D
* caches alias. This is indicated by bits 9 and 21 of the * caches alias.
* cache type register.
*/ */
cache_type = read_cpuid_cachetype(); if (aliasing)
if (cache_type != read_cpuid_id()) { do_align = filp || (flags & MAP_SHARED);
aliasing = (cache_type | cache_type >> 12) & (1 << 11);
if (aliasing)
do_align = filp || flags & MAP_SHARED;
}
#else
#define do_align 0
#define aliasing 0
#endif
/* /*
* We enforce the MAP_FIXED case. * We enforce the MAP_FIXED case.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment