diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c index 0c312fc245a6..05a2ea81906f 100644 --- a/sys/arch/sparc/sparc/cpu.c +++ b/sys/arch/sparc/sparc/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.192 2005/06/19 20:00:28 thorpej Exp $ */ +/* $NetBSD: cpu.c,v 1.193 2005/10/25 22:12:07 uwe Exp $ */ /* * Copyright (c) 1996 @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.192 2005/06/19 20:00:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.193 2005/10/25 22:12:07 uwe Exp $"); #include "opt_multiprocessor.h" #include "opt_lockdebug.h" @@ -1335,7 +1335,8 @@ getcacheinfo_obp(sc, node) 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); @@ -1856,7 +1857,8 @@ getcacheinfo_sun4d(sc, node) 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 */