diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-02 13:49:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-02 13:49:21 -0500 |
commit | b3613118eb30a589d971e4eccbbb2a1314f5dfd4 (patch) | |
tree | 868c1ee59e1b5c19a4f2e43716400d0001a994e5 /arch/arm/mm/mmap.c | |
parent | 7505afe28c16a8d386624930a018d0052c75d687 (diff) | |
parent | 5983fe2b29df5885880d7fa3b91aca306c7564ef (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'arch/arm/mm/mmap.c')
-rw-r--r-- | arch/arm/mm/mmap.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index 74be05f3e03a..44b628e4d6ea 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -9,8 +9,7 @@ | |||
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/personality.h> | 10 | #include <linux/personality.h> |
11 | #include <linux/random.h> | 11 | #include <linux/random.h> |
12 | #include <asm/cputype.h> | 12 | #include <asm/cachetype.h> |
13 | #include <asm/system.h> | ||
14 | 13 | ||
15 | #define COLOUR_ALIGN(addr,pgoff) \ | 14 | #define COLOUR_ALIGN(addr,pgoff) \ |
16 | ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ | 15 | ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ |
@@ -32,25 +31,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
32 | struct mm_struct *mm = current->mm; | 31 | struct mm_struct *mm = current->mm; |
33 | struct vm_area_struct *vma; | 32 | struct vm_area_struct *vma; |
34 | unsigned long start_addr; | 33 | unsigned long start_addr; |
35 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) | 34 | int do_align = 0; |
36 | unsigned int cache_type; | 35 | int aliasing = cache_is_vipt_aliasing(); |
37 | int do_align = 0, aliasing = 0; | ||
38 | 36 | ||
39 | /* | 37 | /* |
40 | * We only need to do colour alignment if either the I or D | 38 | * We only need to do colour alignment if either the I or D |
41 | * caches alias. This is indicated by bits 9 and 21 of the | 39 | * caches alias. |
42 | * cache type register. | ||
43 | */ | 40 | */ |
44 | cache_type = read_cpuid_cachetype(); | 41 | if (aliasing) |
45 | if (cache_type != read_cpuid_id()) { | 42 | do_align = filp || (flags & MAP_SHARED); |
46 | aliasing = (cache_type | cache_type >> 12) & (1 << 11); | ||
47 | if (aliasing) | ||
48 | do_align = filp || flags & MAP_SHARED; | ||
49 | } | ||
50 | #else | ||
51 | #define do_align 0 | ||
52 | #define aliasing 0 | ||
53 | #endif | ||
54 | 43 | ||
55 | /* | 44 | /* |
56 | * We enforce the MAP_FIXED case. | 45 | * We enforce the MAP_FIXED case. |