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 * getcacheinfo_obp(): also initialise t...



details:   https://anonhg.NetBSD.org/src/rev/0075cc7f2983
branches:  trunk
changeset: 540631:0075cc7f2983
user:      pk <pk%NetBSD.org@localhost>
date:      Sat Dec 21 11:48:55 2002 +0000

description:
* getcacheinfo_obp(): also initialise the cacheinfo i/d associativity fields
  in the case of a unified cache.
* xcall(): slightly optimise the `wait for other CPUs' loop.

diffstat:

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

diffs (62 lines):

diff -r 47c607d84cc8 -r 0075cc7f2983 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Sat Dec 21 08:11:28 2002 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Sat Dec 21 11:48:55 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.141 2002/12/19 11:20:30 pk Exp $ */
+/*     $NetBSD: cpu.c,v 1.142 2002/12/21 11:48:55 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -506,7 +506,7 @@
        cpu_hatched = 1;
 #if 0
        /* Flush cache line */
-       cpuinfo.cache_flush((caddr_t)&cpu_hatched, sizeof(cpu_hatched), 0);
+       cpuinfo.sp_cache_flush((caddr_t)&cpu_hatched, sizeof(cpu_hatched), 0);
 #endif
 }
 
@@ -626,6 +626,12 @@
        done = 0;
        i = 100000;     /* time-out */
        while (!done) {
+               if (--i < 0) {
+                       printf("xcall(cpu%d,%p): couldn't ping cpus:",
+                           cpuinfo.ci_cpuid, func);
+                       break;
+               }
+
                done = 1;
                for (n = 0; n < ncpu; n++) {
                        struct cpu_info *cpi = cpus[n];
@@ -633,13 +639,10 @@
                        if (CPU_READY(cpi))
                                continue;
 
-                       if ((cpi->flags & CPUFLG_GOTMSG) == 0)
+                       if ((cpi->flags & CPUFLG_GOTMSG) == 0) {
                                done = 0;
-               }
-               if (!done && i-- < 0) {
-                       printf("xcall(cpu%d,%p): couldn't ping cpus:",
-                           cpuinfo.ci_cpuid, func);
-                       break;
+                               break;
+                       }
                }
        }
        for (n = 0; n < ncpu; n++) {
@@ -1150,9 +1153,11 @@
                if ((1 << i) != l && l)
                        panic("bad cache line size %d", l);
                ci->c_l2linesize = i;
-               ci->c_totalsize = l *
-                       ci->c_nlines *
+               ci->c_associativity =
                        PROM_getpropint(node, "cache-associativity", 1);
+               ci->dc_associativity = ci->ic_associativity =
+                       ci->c_associativity;
+               ci->c_totalsize = l * ci->c_nlines * ci->c_associativity;
        }
        
        if (node_has_property(node, "ecache-nlines")) {



Home | Main Index | Thread Index | Old Index