aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/c-r4k.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r--arch/mips/mm/c-r4k.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 6721ee2b1e8b..eeb642e4066e 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) 6 * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
7 * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org) 7 * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org)
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */ 9 */
@@ -42,14 +42,14 @@
42 * o collapses to normal function call on UP kernels 42 * o collapses to normal function call on UP kernels
43 * o collapses to normal function call on systems with a single shared 43 * o collapses to normal function call on systems with a single shared
44 * primary cache. 44 * primary cache.
45 * o doesn't disable interrupts on the local CPU
45 */ 46 */
46static inline void r4k_on_each_cpu(void (*func) (void *info), void *info, 47static inline void r4k_on_each_cpu(void (*func) (void *info), void *info)
47 int wait)
48{ 48{
49 preempt_disable(); 49 preempt_disable();
50 50
51#if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC) 51#if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC)
52 smp_call_function(func, info, wait); 52 smp_call_function(func, info, 1);
53#endif 53#endif
54 func(info); 54 func(info);
55 preempt_enable(); 55 preempt_enable();
@@ -363,7 +363,7 @@ static inline void local_r4k___flush_cache_all(void * args)
363 363
364static void r4k___flush_cache_all(void) 364static void r4k___flush_cache_all(void)
365{ 365{
366 r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1); 366 r4k_on_each_cpu(local_r4k___flush_cache_all, NULL);
367} 367}
368 368
369static inline int has_valid_asid(const struct mm_struct *mm) 369static inline int has_valid_asid(const struct mm_struct *mm)
@@ -410,7 +410,7 @@ static void r4k_flush_cache_range(struct vm_area_struct *vma,
410 int exec = vma->vm_flags & VM_EXEC; 410 int exec = vma->vm_flags & VM_EXEC;
411 411
412 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) 412 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc))
413 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1); 413 r4k_on_each_cpu(local_r4k_flush_cache_range, vma);
414} 414}
415 415
416static inline void local_r4k_flush_cache_mm(void * args) 416static inline void local_r4k_flush_cache_mm(void * args)
@@ -442,7 +442,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
442 if (!cpu_has_dc_aliases) 442 if (!cpu_has_dc_aliases)
443 return; 443 return;
444 444
445 r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1); 445 r4k_on_each_cpu(local_r4k_flush_cache_mm, mm);
446} 446}
447 447
448struct flush_cache_page_args { 448struct flush_cache_page_args {
@@ -534,7 +534,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
534 args.addr = addr; 534 args.addr = addr;
535 args.pfn = pfn; 535 args.pfn = pfn;
536 536
537 r4k_on_each_cpu(local_r4k_flush_cache_page, &args, 1); 537 r4k_on_each_cpu(local_r4k_flush_cache_page, &args);
538} 538}
539 539
540static inline void local_r4k_flush_data_cache_page(void * addr) 540static inline void local_r4k_flush_data_cache_page(void * addr)
@@ -547,8 +547,7 @@ static void r4k_flush_data_cache_page(unsigned long addr)
547 if (in_atomic()) 547 if (in_atomic())
548 local_r4k_flush_data_cache_page((void *)addr); 548 local_r4k_flush_data_cache_page((void *)addr);
549 else 549 else
550 r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 550 r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr);
551 1);
552} 551}
553 552
554struct flush_icache_range_args { 553struct flush_icache_range_args {
@@ -589,7 +588,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
589 args.start = start; 588 args.start = start;
590 args.end = end; 589 args.end = end;
591 590
592 r4k_on_each_cpu(local_r4k_flush_icache_range_ipi, &args, 1); 591 r4k_on_each_cpu(local_r4k_flush_icache_range_ipi, &args);
593 instruction_hazard(); 592 instruction_hazard();
594} 593}
595 594
@@ -710,7 +709,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg)
710 709
711static void r4k_flush_cache_sigtramp(unsigned long addr) 710static void r4k_flush_cache_sigtramp(unsigned long addr)
712{ 711{
713 r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1); 712 r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr);
714} 713}
715 714
716static void r4k_flush_icache_all(void) 715static void r4k_flush_icache_all(void)
@@ -1007,6 +1006,7 @@ static void __cpuinit probe_pcache(void)
1007 case CPU_25KF: 1006 case CPU_25KF:
1008 case CPU_SB1: 1007 case CPU_SB1:
1009 case CPU_SB1A: 1008 case CPU_SB1A:
1009 case CPU_XLR:
1010 c->dcache.flags |= MIPS_CACHE_PINDEX; 1010 c->dcache.flags |= MIPS_CACHE_PINDEX;
1011 break; 1011 break;
1012 1012
@@ -1076,7 +1076,6 @@ static int __cpuinit probe_scache(void)
1076 unsigned long flags, addr, begin, end, pow2; 1076 unsigned long flags, addr, begin, end, pow2;
1077 unsigned int config = read_c0_config(); 1077 unsigned int config = read_c0_config();
1078 struct cpuinfo_mips *c = &current_cpu_data; 1078 struct cpuinfo_mips *c = &current_cpu_data;
1079 int tmp;
1080 1079
1081 if (config & CONF_SC) 1080 if (config & CONF_SC)
1082 return 0; 1081 return 0;
@@ -1109,7 +1108,6 @@ static int __cpuinit probe_scache(void)
1109 1108
1110 /* Now search for the wrap around point. */ 1109 /* Now search for the wrap around point. */
1111 pow2 = (128 * 1024); 1110 pow2 = (128 * 1024);
1112 tmp = 0;
1113 for (addr = begin + (128 * 1024); addr < end; addr = begin + pow2) { 1111 for (addr = begin + (128 * 1024); addr < end; addr = begin + pow2) {
1114 cache_op(Index_Load_Tag_SD, addr); 1112 cache_op(Index_Load_Tag_SD, addr);
1115 __asm__ __volatile__("nop; nop; nop; nop;"); /* hazard... */ 1113 __asm__ __volatile__("nop; nop; nop; nop;"); /* hazard... */