aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/kmap.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-09-09 04:14:19 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-09-09 04:14:19 -0400
commitf9e2bdfdbb4c9da13422b349227be8c7b41dbd44 (patch)
tree0cda3a72cbf51cf4e907e0cbef4dce24a6d08b7e /arch/sh/mm/kmap.c
parentc4845a4b2288a9e5d96a0558e474809028c8aff3 (diff)
sh: Factor in cpu id for selection of cache colour fixmap.
In the SMP VIPT case the page copy/clear ops still perform colouring, care needs to be taken that CPUs don't end up stepping on each other, so we give them a bit of room to work with. At the same time, we reduce the worst-case colouring given that these pages are always consumed. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/kmap.c')
-rw-r--r--arch/sh/mm/kmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sh/mm/kmap.c b/arch/sh/mm/kmap.c
index 16e01b5fed04..15d74ea42094 100644
--- a/arch/sh/mm/kmap.c
+++ b/arch/sh/mm/kmap.c
@@ -39,7 +39,9 @@ void *kmap_coherent(struct page *page, unsigned long addr)
39 pagefault_disable(); 39 pagefault_disable();
40 40
41 idx = FIX_CMAP_END - 41 idx = FIX_CMAP_END -
42 ((addr & current_cpu_data.dcache.alias_mask) >> PAGE_SHIFT); 42 (((addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1)) +
43 (FIX_N_COLOURS * smp_processor_id()));
44
43 vaddr = __fix_to_virt(idx); 45 vaddr = __fix_to_virt(idx);
44 46
45 BUG_ON(!pte_none(*(kmap_coherent_pte - idx))); 47 BUG_ON(!pte_none(*(kmap_coherent_pte - idx)));