Commit 5e3679c5 authored by Paul Mundt's avatar Paul Mundt

Merge branch 'sh/cachetlb'

parents a469f627 f9e2bdfd
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#define _ASM_FIXMAP_H #define _ASM_FIXMAP_H
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/threads.h>
#include <asm/page.h> #include <asm/page.h>
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
#include <linux/threads.h>
#include <asm/kmap_types.h> #include <asm/kmap_types.h>
#endif #endif
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
* fix-mapped? * fix-mapped?
*/ */
enum fixed_addresses { enum fixed_addresses {
#define FIX_N_COLOURS 16 #define FIX_N_COLOURS 8
FIX_CMAP_BEGIN, FIX_CMAP_BEGIN,
FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS, FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
FIX_UNCACHED, FIX_UNCACHED,
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
......
This diff is collapsed.
...@@ -164,11 +164,17 @@ void flush_cache_all(void) ...@@ -164,11 +164,17 @@ void flush_cache_all(void)
void flush_cache_mm(struct mm_struct *mm) void flush_cache_mm(struct mm_struct *mm)
{ {
if (boot_cpu_data.dcache.n_aliases == 0)
return;
cacheop_on_each_cpu(local_flush_cache_mm, mm, 1); cacheop_on_each_cpu(local_flush_cache_mm, mm, 1);
} }
void flush_cache_dup_mm(struct mm_struct *mm) void flush_cache_dup_mm(struct mm_struct *mm)
{ {
if (boot_cpu_data.dcache.n_aliases == 0)
return;
cacheop_on_each_cpu(local_flush_cache_dup_mm, mm, 1); cacheop_on_each_cpu(local_flush_cache_dup_mm, mm, 1);
} }
......
...@@ -39,7 +39,9 @@ void *kmap_coherent(struct page *page, unsigned long addr) ...@@ -39,7 +39,9 @@ void *kmap_coherent(struct page *page, unsigned long addr)
pagefault_disable(); pagefault_disable();
idx = FIX_CMAP_END - idx = FIX_CMAP_END -
((addr & current_cpu_data.dcache.alias_mask) >> PAGE_SHIFT); (((addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1)) +
(FIX_N_COLOURS * smp_processor_id()));
vaddr = __fix_to_virt(idx); vaddr = __fix_to_virt(idx);
BUG_ON(!pte_none(*(kmap_coherent_pte - idx))); BUG_ON(!pte_none(*(kmap_coherent_pte - idx)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment