Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/arch/x86/x86 Pull up revision 1.6 (requested by bri...
details: https://anonhg.NetBSD.org/src/rev/a491160ac7d8
branches: netbsd-2-0
changeset: 562418:a491160ac7d8
user: tron <tron%NetBSD.org@localhost>
date: Sun Aug 22 13:33:52 2004 +0000
description:
Pull up revision 1.6 (requested by briggs in ticket #770):
Get correct cache information for earlier VIA C3 models.
Mostly from PR kern/26689 submitted by Michael van Elst.
diffstat:
sys/arch/x86/x86/cacheinfo.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 420eb100e44d -r a491160ac7d8 sys/arch/x86/x86/cacheinfo.c
--- a/sys/arch/x86/x86/cacheinfo.c Sun Aug 22 13:33:45 2004 +0000
+++ b/sys/arch/x86/x86/cacheinfo.c Sun Aug 22 13:33:52 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cacheinfo.c,v 1.3.2.2 2004/08/12 03:31:18 jmc Exp $ */
+/* $NetBSD: cacheinfo.c,v 1.3.2.3 2004/08/22 13:33:52 tron Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cacheinfo.c,v 1.3.2.2 2004/08/12 03:31:18 jmc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cacheinfo.c,v 1.3.2.3 2004/08/22 13:33:52 tron Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -318,9 +318,15 @@
CPUID(0x80000006, descs[0], descs[1], descs[2], descs[3]);
cai = &ci->ci_cinfo[CAI_L2CACHE];
- cai->cai_totalsize = VIA_L2_ECX_C_SIZE(descs[2]);
- cai->cai_associativity = VIA_L2_ECX_C_ASSOC(descs[2]);
- cai->cai_linesize = VIA_L2_ECX_C_LS(descs[2]);
+ if (model >= 9) {
+ cai->cai_totalsize = VIA_L2N_ECX_C_SIZE(descs[2]);
+ cai->cai_associativity = VIA_L2N_ECX_C_ASSOC(descs[2]);
+ cai->cai_linesize = VIA_L2N_ECX_C_LS(descs[2]);
+ } else {
+ cai->cai_totalsize = VIA_L2_ECX_C_SIZE(descs[2]);
+ cai->cai_associativity = VIA_L2_ECX_C_ASSOC(descs[2]);
+ cai->cai_linesize = VIA_L2_ECX_C_LS(descs[2]);
+ }
}
void
Home |
Main Index |
Thread Index |
Old Index