summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1998-12-05 16:30:55 +0000
committerkato <kato@FreeBSD.org>1998-12-05 16:30:55 +0000
commit0ebf3be7f1bb2a7a90508f4b5703e771dc3cf264 (patch)
tree6d4507fdc69e2342b130cc97dad958155fbbf9cc /sys/amd64
parente625ce3562b4965aa85921ff38423b8a58862c6b (diff)
downloadFreeBSD-src-0ebf3be7f1bb2a7a90508f4b5703e771dc3cf264.zip
FreeBSD-src-0ebf3be7f1bb2a7a90508f4b5703e771dc3cf264.tar.gz
Print out information for write-allocate of AMD CPUs.
Submitted by: Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/identcpu.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c
index 98b9edf..9b6d722 100644
--- a/sys/amd64/amd64/identcpu.c
+++ b/sys/amd64/amd64/identcpu.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.51 1998/07/11 07:45:28 bde Exp $
+ * $Id: identcpu.c,v 1.52 1998/10/06 13:16:23 kato Exp $
*/
#include "opt_cpu.h"
@@ -839,6 +839,7 @@ static void
print_AMD_info(void)
{
u_int regs[4];
+ quad_t amd_whcr;
do_cpuid(0x80000000, regs);
if (regs[0] >= 0x80000005) {
@@ -856,4 +857,22 @@ print_AMD_info(void)
printf(", %d lines/tag", (regs[3] >> 8) & 0xff);
print_AMD_assoc((regs[3] >> 16) & 0xff);
}
+ switch (cpu_id & 0xFF0) {
+ case 0x560: /* K6 0.35u */
+ case 0x570: /* K6 0.25u */
+ case 0x580: /* K6-2 */
+ case 0x590: /* K6-3 */
+ amd_whcr = rdmsr(0xc0000082);
+ if (!(amd_whcr & 0x00fe)) {
+ printf("Write Allocate Disable\n");
+ } else {
+ printf("Write Allocate Enable Limit: %dM bytes\n",
+ (u_int32_t)(amd_whcr & 0x00fe) * 2);
+ printf("Write Allocate 15-16M bytes: %s\n",
+ (amd_whcr & 0x0001) ? "Enable" : "Disable");
+ printf("Hardware Write Allocate Control: %s\n",
+ (amd_whcr & 0x0100) ? "Enable" : "Disable");
+ }
+ break;
+ }
}
OpenPOWER on IntegriCloud