diff options
-rw-r--r-- | arch/mips/mm/c-sb1.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c index d0ddb4a768a5..3a8afd47feaa 100644 --- a/arch/mips/mm/c-sb1.c +++ b/arch/mips/mm/c-sb1.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/hardirq.h> | ||
22 | 23 | ||
23 | #include <asm/asm.h> | 24 | #include <asm/asm.h> |
24 | #include <asm/bootinfo.h> | 25 | #include <asm/bootinfo.h> |
@@ -242,6 +243,25 @@ void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsign | |||
242 | __attribute__((alias("local_sb1_flush_cache_page"))); | 243 | __attribute__((alias("local_sb1_flush_cache_page"))); |
243 | #endif | 244 | #endif |
244 | 245 | ||
246 | #ifdef CONFIG_SMP | ||
247 | static void sb1_flush_cache_data_page_ipi(void *info) | ||
248 | { | ||
249 | unsigned long start = (unsigned long)info; | ||
250 | |||
251 | __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE); | ||
252 | } | ||
253 | |||
254 | static void sb1_flush_cache_data_page(unsigned long addr) | ||
255 | { | ||
256 | if (in_atomic()) | ||
257 | __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE); | ||
258 | else | ||
259 | on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1); | ||
260 | } | ||
261 | #else | ||
262 | void sb1_flush_cache_data_page(unsigned long) | ||
263 | __attribute__((alias("local_sb1_flush_cache_data_page"))); | ||
264 | #endif | ||
245 | 265 | ||
246 | /* | 266 | /* |
247 | * Invalidate all caches on this CPU | 267 | * Invalidate all caches on this CPU |
@@ -481,7 +501,7 @@ void sb1_cache_init(void) | |||
481 | 501 | ||
482 | flush_cache_sigtramp = sb1_flush_cache_sigtramp; | 502 | flush_cache_sigtramp = sb1_flush_cache_sigtramp; |
483 | local_flush_data_cache_page = (void *) sb1_nop; | 503 | local_flush_data_cache_page = (void *) sb1_nop; |
484 | flush_data_cache_page = (void *) sb1_nop; | 504 | flush_data_cache_page = sb1_flush_cache_data_page; |
485 | 505 | ||
486 | /* Full flush */ | 506 | /* Full flush */ |
487 | __flush_cache_all = sb1___flush_cache_all; | 507 | __flush_cache_all = sb1___flush_cache_all; |