diff options
Diffstat (limited to 'arch/arm/mm/cache-v4wb.S')
-rw-r--r-- | arch/arm/mm/cache-v4wb.S | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S index 5c4055b62d97..54e3c5bb5186 100644 --- a/arch/arm/mm/cache-v4wb.S +++ b/arch/arm/mm/cache-v4wb.S | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <asm/hardware.h> | 13 | #include <asm/memory.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | #include "proc-macros.S" | 15 | #include "proc-macros.S" |
16 | 16 | ||
@@ -46,6 +46,11 @@ | |||
46 | */ | 46 | */ |
47 | #define CACHE_DLIMIT (CACHE_DSIZE * 4) | 47 | #define CACHE_DLIMIT (CACHE_DSIZE * 4) |
48 | 48 | ||
49 | .data | ||
50 | flush_base: | ||
51 | .long FLUSH_BASE | ||
52 | .text | ||
53 | |||
49 | /* | 54 | /* |
50 | * flush_user_cache_all() | 55 | * flush_user_cache_all() |
51 | * | 56 | * |
@@ -63,11 +68,21 @@ ENTRY(v4wb_flush_kern_cache_all) | |||
63 | mov ip, #0 | 68 | mov ip, #0 |
64 | mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache | 69 | mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache |
65 | __flush_whole_cache: | 70 | __flush_whole_cache: |
66 | mov r0, #FLUSH_BASE | 71 | ldr r3, =flush_base |
67 | add r1, r0, #CACHE_DSIZE | 72 | ldr r1, [r3, #0] |
68 | 1: ldr r2, [r0], #32 | 73 | eor r1, r1, #CACHE_DSIZE |
69 | cmp r0, r1 | 74 | str r1, [r3, #0] |
75 | add r2, r1, #CACHE_DSIZE | ||
76 | 1: ldr r3, [r1], #32 | ||
77 | cmp r1, r2 | ||
78 | blo 1b | ||
79 | #ifdef FLUSH_BASE_MINICACHE | ||
80 | add r2, r2, #FLUSH_BASE_MINICACHE - FLUSH_BASE | ||
81 | sub r1, r2, #512 @ only 512 bytes | ||
82 | 1: ldr r3, [r1], #32 | ||
83 | cmp r1, r2 | ||
70 | blo 1b | 84 | blo 1b |
85 | #endif | ||
71 | mcr p15, 0, ip, c7, c10, 4 @ drain write buffer | 86 | mcr p15, 0, ip, c7, c10, 4 @ drain write buffer |
72 | mov pc, lr | 87 | mov pc, lr |
73 | 88 | ||
@@ -82,6 +97,7 @@ __flush_whole_cache: | |||
82 | * - flags - vma_area_struct flags describing address space | 97 | * - flags - vma_area_struct flags describing address space |
83 | */ | 98 | */ |
84 | ENTRY(v4wb_flush_user_cache_range) | 99 | ENTRY(v4wb_flush_user_cache_range) |
100 | mov ip, #0 | ||
85 | sub r3, r1, r0 @ calculate total size | 101 | sub r3, r1, r0 @ calculate total size |
86 | tst r2, #VM_EXEC @ executable region? | 102 | tst r2, #VM_EXEC @ executable region? |
87 | mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache | 103 | mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache |