Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Rob Herring and committed by
Russell King
41dfaa93 7334c675

+6 -17
+6 -17
arch/arm/mm/mmap.c
··· 9 9 #include <linux/io.h> 10 10 #include <linux/personality.h> 11 11 #include <linux/random.h> 12 - #include <asm/cputype.h> 13 - #include <asm/system.h> 12 + #include <asm/cachetype.h> 14 13 15 14 #define COLOUR_ALIGN(addr,pgoff) \ 16 15 ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ ··· 31 32 struct mm_struct *mm = current->mm; 32 33 struct vm_area_struct *vma; 33 34 unsigned long start_addr; 34 - #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 35 - unsigned int cache_type; 36 - int do_align = 0, aliasing = 0; 35 + int do_align = 0; 36 + int aliasing = cache_is_vipt_aliasing(); 37 37 38 38 /* 39 39 * We only need to do colour alignment if either the I or D 40 - * caches alias. This is indicated by bits 9 and 21 of the 41 - * cache type register. 40 + * caches alias. 42 41 */ 43 - cache_type = read_cpuid_cachetype(); 44 - if (cache_type != read_cpuid_id()) { 45 - aliasing = (cache_type | cache_type >> 12) & (1 << 11); 46 - if (aliasing) 47 - do_align = filp || flags & MAP_SHARED; 48 - } 49 - #else 50 - #define do_align 0 51 - #define aliasing 0 52 - #endif 42 + if (aliasing) 43 + do_align = filp || (flags & MAP_SHARED); 53 44 54 45 /* 55 46 * We enforce the MAP_FIXED case.