Source-Changes-HG archive

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

[src/netbsd-2-1]: src/sys/arch/sparc/sparc Pull up following revision(s) (req...



details:   https://anonhg.NetBSD.org/src/rev/c6c786cf8d18
branches:  netbsd-2-1
changeset: 564107:c6c786cf8d18
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Oct 30 17:40:53 2005 +0000

description:
Pull up following revision(s) (requested by uwe in ticket #5950):
        sys/arch/sparc/sparc/cpu.c: revision 1.193
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 d2d5ad0e738d -r c6c786cf8d18 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Fri Oct 28 23:46:04 2005 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Sun Oct 30 17:40:53 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.181.2.2 2004/05/10 14:40:47 tron Exp $ */
+/*     $NetBSD: cpu.c,v 1.181.2.2.4.1 2005/10/30 17:40:53 riz Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.181.2.2 2004/05/10 14:40:47 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.181.2.2.4.1 2005/10/30 17:40:53 riz 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