Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/sparc MULTIPROCESSOR: if the cache flush func...



details:   https://anonhg.NetBSD.org/src/rev/d9dab00ce4d1
branches:  trunk
changeset: 497104:d9dab00ce4d1
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Sep 19 13:44:35 2000 +0000

description:
MULTIPROCESSOR: if the cache flush functions are no-ops on a single
processor, they can be no-ops in the MP case as well.

diffstat:

 sys/arch/sparc/sparc/cpu.c |  22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diffs (36 lines):

diff -r 8d67ad2c9cc7 -r d9dab00ce4d1 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Tue Sep 19 13:04:38 2000 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Tue Sep 19 13:44:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.107 2000/09/10 11:32:04 pk Exp $ */
+/*     $NetBSD: cpu.c,v 1.108 2000/09/19 13:44:35 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -362,12 +362,20 @@
        cache_print(sc);
 
        if (cpu_instance == ncpu) {
-               /* Install MP cache flush functions on boot cpu */
-               cpuinfo.cache_flush = smp_cache_flush;
-               cpuinfo.vcache_flush_page = smp_vcache_flush_page;
-               cpuinfo.vcache_flush_segment = smp_vcache_flush_segment;
-               cpuinfo.vcache_flush_region = smp_vcache_flush_region;
-               cpuinfo.vcache_flush_context = smp_vcache_flush_context;
+               /*
+                * Install MP cache flush functions on boot cpu, unless
+                * the single-processor versions are no-ops.
+                */
+               if (cpuinfo.cache_flush != noop_cache_flush)
+                       cpuinfo.cache_flush = smp_cache_flush;
+               if (cpuinfo.vcache_flush_page != noop_vcache_flush_page)
+                       cpuinfo.vcache_flush_page = smp_vcache_flush_page;
+               if (cpuinfo.vcache_flush_segment != noop_vcache_flush_segment)
+                       cpuinfo.vcache_flush_segment = smp_vcache_flush_segment;
+               if (cpuinfo.vcache_flush_region != noop_vcache_flush_region)
+                       cpuinfo.vcache_flush_region = smp_vcache_flush_region;
+               if (cpuinfo.vcache_flush_context != noop_vcache_flush_context)
+                       cpuinfo.vcache_flush_context = smp_vcache_flush_context;
        }
 #endif /* MULTIPROCESSOR */
 }



Home | Main Index | Thread Index | Old Index