Module Name: src
Committed By: msaitoh
Date: Tue Nov 12 16:13:56 UTC 2013
Modified Files:
src/sys/arch/x86/x86: cpu.c identcpu.c
Log Message:
Fix a bug in last commit. Check correct variable.
To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x86/x86/identcpu.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.103 src/sys/arch/x86/x86/cpu.c:1.104
--- src/sys/arch/x86/x86/cpu.c:1.103 Wed Oct 23 20:18:50 2013
+++ src/sys/arch/x86/x86/cpu.c Tue Nov 12 16:13:56 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.103 2013/10/23 20:18:50 drochner Exp $ */
+/* $NetBSD: cpu.c,v 1.104 2013/11/12 16:13:56 msaitoh Exp $ */
/*-
* Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.103 2013/10/23 20:18:50 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.104 2013/11/12 16:13:56 msaitoh Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -245,6 +245,7 @@ cpu_vm_init(struct cpu_info *ci)
struct x86_cache_info *cai;
int tcolors;
+ printf("CAI = %d\n", i);
cai = &ci->ci_cinfo[i];
tcolors = atop(cai->cai_totalsize);
@@ -258,6 +259,8 @@ cpu_vm_init(struct cpu_info *ci)
default:
tcolors /= cai->cai_associativity;
}
+ printf("associativity = %d, totalsize = %d\n",
+ cai->cai_associativity, cai->cai_totalsize);
ncolors = max(ncolors, tcolors);
/*
* If the desired number of colors is not a power of
Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.36 src/sys/arch/x86/x86/identcpu.c:1.37
--- src/sys/arch/x86/x86/identcpu.c:1.36 Tue Nov 12 16:11:39 2013
+++ src/sys/arch/x86/x86/identcpu.c Tue Nov 12 16:13:56 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: identcpu.c,v 1.36 2013/11/12 16:11:39 msaitoh Exp $ */
+/* $NetBSD: identcpu.c,v 1.37 2013/11/12 16:13:56 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.36 2013/11/12 16:11:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.37 2013/11/12 16:13:56 msaitoh Exp $");
#include "opt_xen.h"
@@ -122,7 +122,7 @@ cpu_probe_amd_cache(struct cpu_info *ci)
if (family == 0xf)
family += CPUID2EXTFAMILY(ci->ci_signature);
- if ((family == 0xf) || (model == 0x6))
+ if ((family == 0xf) || (family == 0x6))
model |= CPUID2EXTMODEL(ci->ci_signature) << 4;
/*