diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-01-07 07:30:20 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-01-07 07:42:17 -0500 |
commit | 237c78beb8a988453bac1993d21f025d070a0d8d (patch) | |
tree | 9864f0924650770881141359a2d5bac623949789 /arch/arm/mm/context.c | |
parent | 4eb821999086417ab42a15174b51497122fc406e (diff) | |
parent | 7b9dd47136c07ffd883aff6926c7b281e4c1eea4 (diff) |
Merge branch 'depends/rmk/for-linus' into samsung/dt
Conflicts:
arch/arm/mach-exynos/Makefile
arch/arm/mach-exynos/cpu.c -> common.c
arch/arm/mach-exynos/include/mach/entry-macro.S
arch/arm/mach-exynos/init.c -> common.c
arch/arm/mach-s5p64x0/init.c -> common.c
arch/arm/mach-s5pv210/init.c -> common.c
Multiple files were moved into common.c files in the rmk/for-linus
branch, so this moves over the samsung/dt changes to the new
files.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mm/context.c')
-rw-r--r-- | arch/arm/mm/context.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 93aac068da94..ee9bb363d606 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -22,6 +22,21 @@ unsigned int cpu_last_asid = ASID_FIRST_VERSION; | |||
22 | DEFINE_PER_CPU(struct mm_struct *, current_mm); | 22 | DEFINE_PER_CPU(struct mm_struct *, current_mm); |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #ifdef CONFIG_ARM_LPAE | ||
26 | #define cpu_set_asid(asid) { \ | ||
27 | unsigned long ttbl, ttbh; \ | ||
28 | asm volatile( \ | ||
29 | " mrrc p15, 0, %0, %1, c2 @ read TTBR0\n" \ | ||
30 | " mov %1, %2, lsl #(48 - 32) @ set ASID\n" \ | ||
31 | " mcrr p15, 0, %0, %1, c2 @ set TTBR0\n" \ | ||
32 | : "=&r" (ttbl), "=&r" (ttbh) \ | ||
33 | : "r" (asid & ~ASID_MASK)); \ | ||
34 | } | ||
35 | #else | ||
36 | #define cpu_set_asid(asid) \ | ||
37 | asm(" mcr p15, 0, %0, c13, c0, 1\n" : : "r" (asid)) | ||
38 | #endif | ||
39 | |||
25 | /* | 40 | /* |
26 | * We fork()ed a process, and we need a new context for the child | 41 | * We fork()ed a process, and we need a new context for the child |
27 | * to run in. We reserve version 0 for initial tasks so we will | 42 | * to run in. We reserve version 0 for initial tasks so we will |
@@ -37,7 +52,7 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
37 | static void flush_context(void) | 52 | static void flush_context(void) |
38 | { | 53 | { |
39 | /* set the reserved ASID before flushing the TLB */ | 54 | /* set the reserved ASID before flushing the TLB */ |
40 | asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (0)); | 55 | cpu_set_asid(0); |
41 | isb(); | 56 | isb(); |
42 | local_flush_tlb_all(); | 57 | local_flush_tlb_all(); |
43 | if (icache_is_vivt_asid_tagged()) { | 58 | if (icache_is_vivt_asid_tagged()) { |
@@ -99,7 +114,7 @@ static void reset_context(void *info) | |||
99 | set_mm_context(mm, asid); | 114 | set_mm_context(mm, asid); |
100 | 115 | ||
101 | /* set the new ASID */ | 116 | /* set the new ASID */ |
102 | asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (mm->context.id)); | 117 | cpu_set_asid(mm->context.id); |
103 | isb(); | 118 | isb(); |
104 | } | 119 | } |
105 | 120 | ||