Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/arch/sparc/sparc Pullup rev 1.193 (requested by uwe i...



details:   https://anonhg.NetBSD.org/src/rev/219a123d5a4b
branches:  netbsd-3
changeset: 577417:219a123d5a4b
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Oct 30 02:15:01 2005 +0000

description:
Pullup rev 1.193 (requested by uwe in ticket #919)
 Compute c_totalsize for split caches correctly: it's max, not sum (and
 we even have that documented in cache.h). Initialize c_nlines for
 split caches.

 This should fix srmmu cache flush routines for split I/D caches that
 has been broken since cache.c revision 1.79 started using c_nlines.

diffstat:

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

diffs (38 lines):

diff -r 36aade0e0bf0 -r 219a123d5a4b sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Fri Oct 28 23:56:02 2005 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Sun Oct 30 02:15:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.186 2004/05/07 14:59:26 pk Exp $ */
+/*     $NetBSD: cpu.c,v 1.186.10.1 2005/10/30 02:15:01 jmc Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.186 2004/05/07 14:59:26 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.186.10.1 2005/10/30 02:15:01 jmc Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -1327,7 +1327,8 @@
 
                ci->c_l2linesize = min(ci->ic_l2linesize, ci->dc_l2linesize);
                ci->c_linesize = min(ci->ic_linesize, ci->dc_linesize);
-               ci->c_totalsize = ci->ic_totalsize + ci->dc_totalsize;
+               ci->c_totalsize = max(ci->ic_totalsize, ci->dc_totalsize);
+               ci->c_nlines = ci->c_totalsize >> ci->c_l2linesize;
        } else {
                /* unified I/D cache */
                ci->c_nlines = prom_getpropint(node, "cache-nlines", 128);
@@ -1848,7 +1849,8 @@
 
        ci->c_l2linesize = min(ci->ic_l2linesize, ci->dc_l2linesize);
        ci->c_linesize = min(ci->ic_linesize, ci->dc_linesize);
-       ci->c_totalsize = ci->ic_totalsize + ci->dc_totalsize;
+       ci->c_totalsize = max(ci->ic_totalsize, ci->dc_totalsize);
+       ci->c_nlines = ci->c_totalsize >> ci->c_l2linesize;
 
        if (node_has_property(node, "ecache-nlines")) {
                /* we have a L2 "e"xternal cache */



Home | Main Index | Thread Index | Old Index