From 165ba65d7b2714e65c4ee89c2ffa40a40dc03986 Mon Sep 17 00:00:00 2001 From: David Xu Date: Thu, 2 Feb 2006 12:44:09 +0000 Subject: [PATCH] Under verbose mode, correctly report L2 cache information for CPU which supports CPUID function 8000_0006h. Tested on: Pentum-M 750 --- sys/i386/i386/identcpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c index 4f16ea6fef58..8c896b8e6c7e 100644 --- a/sys/i386/i386/identcpu.c +++ b/sys/i386/i386/identcpu.c @@ -1233,6 +1233,7 @@ print_INTEL_info(void) { u_int regs[4]; u_int rounds, regnum; + u_int nwaycode, nway; do_cpuid(0x2, regs); @@ -1266,8 +1267,13 @@ print_INTEL_info(void) if (cpu_exthigh >= 0x80000006) { do_cpuid(0x80000006, regs); + nwaycode = (regs[2] >> 12) & 0x0f; + if (nwaycode >= 0x02 && nwaycode <= 0x08) + nway = 1 << (nwaycode / 2); + else + nway = 0; printf("\nL2 cache: %u kbytes, %u-way associative, %u bytes/line", - regs[2] & 0xffff, (regs[2] >> 16) & 0xff, regs[2] >> 24); + (regs[2] >> 16) & 0xffff, nway, regs[2] & 0xff); } printf("\n");