diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-02-02 12:44:09 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-02-02 12:44:09 +0000 |
commit | c013564a3c8e328932f999cfc27c3da9af2e4c51 (patch) | |
tree | 22f2ba4ed774db9e4b3ba258b1f702fdc80e8366 /sys/i386 | |
parent | 6ccd8f649b442a95c717d221a2cd56ca55296794 (diff) | |
download | FreeBSD-src-c013564a3c8e328932f999cfc27c3da9af2e4c51.zip FreeBSD-src-c013564a3c8e328932f999cfc27c3da9af2e4c51.tar.gz |
Under verbose mode, correctly report L2 cache information
for CPU which supports CPUID function 8000_0006h.
Tested on: Pentum-M 750
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/identcpu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c index 4f16ea6..8c896b8 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"); |