Module Name:    src
Committed By:   chs
Date:           Sat Jun 16 17:30:19 UTC 2012

Modified Files:
        src/sys/arch/amd64/amd64: locore.S
        src/sys/arch/i386/i386: locore.S
        src/sys/arch/x86/include: cpu.h
        src/sys/arch/x86/x86: identcpu.c

Log Message:
rename the global variable "cpu" to "cputype" to avoid conflicting with
dtrace, which wants to use "cpu" as a local variable.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.31 -r1.32 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/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.68 src/sys/arch/amd64/amd64/locore.S:1.69
--- src/sys/arch/amd64/amd64/locore.S:1.68	Thu Apr 19 18:00:34 2012
+++ src/sys/arch/amd64/amd64/locore.S	Sat Jun 16 17:30:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.68 2012/04/19 18:00:34 jym Exp $	*/
+/*	$NetBSD: locore.S,v 1.69 2012/06/16 17:30:19 chs Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -236,9 +236,9 @@ _C_LABEL(lapic_isr):
 	.globl	_C_LABEL(bootinfo),_C_LABEL(atdevbase)
 	.globl	_C_LABEL(PDPpaddr)
 	.globl	_C_LABEL(biosbasemem),_C_LABEL(biosextmem)
-	.globl	_C_LABEL(gdtstore),_C_LABEL(cpu)
+	.globl	_C_LABEL(gdtstore),_C_LABEL(cputype)
 
-_C_LABEL(cpu):		.long	0	# are we 386, 386sx, or 486,
+_C_LABEL(cputype):	.long	0	# are we 386, 386sx, or 486,
 					#   or Pentium, or..
 _C_LABEL(cpu_id):	.long	0	# saved from `cpuid' instruction
 _C_LABEL(cpuid_level):	.long	-1	# max. level accepted by 'cpuid'

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.99 src/sys/arch/i386/i386/locore.S:1.100
--- src/sys/arch/i386/i386/locore.S:1.99	Thu Apr 19 18:07:05 2012
+++ src/sys/arch/i386/i386/locore.S	Sat Jun 16 17:30:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.99 2012/04/19 18:07:05 jym Exp $	*/
+/*	$NetBSD: locore.S,v 1.100 2012/06/16 17:30:19 chs Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -129,7 +129,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.99 2012/04/19 18:07:05 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.100 2012/06/16 17:30:19 chs Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_ddb.h"
@@ -196,7 +196,7 @@ __KERNEL_RCSID(0, "$NetBSD: locore.S,v 1
  */
 	.data
 
-	.globl	_C_LABEL(cpu)
+	.globl	_C_LABEL(cputype)
 	.globl	_C_LABEL(cpuid_level)
 	.globl	_C_LABEL(esym)
 	.globl	_C_LABEL(eblob)
@@ -229,7 +229,7 @@ _C_LABEL(lapic_tpr):
 	.long 0
 #endif
 
-_C_LABEL(cpu):		.long	0	# are we 80486, Pentium, or..
+_C_LABEL(cputype):	.long	0	# are we 80486, Pentium, or..
 _C_LABEL(cpuid_level):	.long	0
 _C_LABEL(atdevbase):	.long	0	# location of start of iomem in virtual
 _C_LABEL(lwp0uarea):	.long	0
@@ -346,11 +346,11 @@ isnx586:
 	 * Don't try cpuid, as Nx586s reportedly don't support the
 	 * PSL_ID bit.
 	 */
-	movl	$CPU_NX586,RELOC(cpu)
+	movl	$CPU_NX586,RELOC(cputype)
 	jmp	2f
 
 is386:
-	movl	$CPU_386,RELOC(cpu)
+	movl	$CPU_386,RELOC(cputype)
 	jmp	2f
 
 try486:	/* Try to toggle identification flag; does not exist on early 486s. */
@@ -369,7 +369,7 @@ try486:	/* Try to toggle identification 
 
 	testl	%eax,%eax
 	jnz	try586
-is486:	movl	$CPU_486,RELOC(cpu)
+is486:	movl	$CPU_486,RELOC(cputype)
 	/*
 	 * Check Cyrix CPU
 	 * Cyrix CPUs do not change the undefined flags following
@@ -387,7 +387,7 @@ is486:	movl	$CPU_486,RELOC(cpu)
 	popfl
 	jmp 2f
 trycyrix486:
-	movl	$CPU_6x86,RELOC(cpu) 	# set CPU type
+	movl	$CPU_6x86,RELOC(cputype)	# set CPU type
 	/*
 	 * Check for Cyrix 486 CPU by seeing if the flags change during a
 	 * divide. This is documented in the Cx486SLC/e SMM Programmer's
@@ -405,7 +405,7 @@ trycyrix486:
 	xorl	%ecx,%eax		# are the flags different?
 	testl	$0x8d5,%eax		# only check C|PF|AF|Z|N|V
 	jne	2f			# yes; must be Cyrix 6x86 CPU
-	movl	$CPU_486DLC,RELOC(cpu) 	# set CPU type
+	movl	$CPU_486DLC,RELOC(cputype) 	# set CPU type
 
 #ifndef CYRIX_CACHE_WORKS
 	/* Disable caching of the ISA hole only. */

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.50 src/sys/arch/x86/include/cpu.h:1.51
--- src/sys/arch/x86/include/cpu.h:1.50	Fri Apr 20 22:23:24 2012
+++ src/sys/arch/x86/include/cpu.h	Sat Jun 16 17:30:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.50 2012/04/20 22:23:24 rmind Exp $	*/
+/*	$NetBSD: cpu.h,v 1.51 2012/06/16 17:30:18 chs Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -360,7 +360,7 @@ struct timeval;
 
 extern int biosbasemem;
 extern int biosextmem;
-extern int cpu;
+extern int cputype;
 extern int cpuid_level;
 extern int cpu_class;
 extern char cpu_brand_string[];

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.31 src/sys/arch/x86/x86/identcpu.c:1.32
--- src/sys/arch/x86/x86/identcpu.c:1.31	Mon Apr 30 00:08:03 2012
+++ src/sys/arch/x86/x86/identcpu.c	Sat Jun 16 17:30:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.31 2012/04/30 00:08:03 christos Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.32 2012/06/16 17:30:19 chs 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.31 2012/04/30 00:08:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.32 2012/06/16 17:30:19 chs Exp $");
 
 #include "opt_xen.h"
 
@@ -613,8 +613,8 @@ cpu_probe(struct cpu_info *ci)
 	uint32_t miscbytes;
 	uint32_t brand[12];
 
-	cpu_vendor = i386_nocpuid_cpus[cpu << 1];
-	cpu_class = i386_nocpuid_cpus[(cpu << 1) + 1];
+	cpu_vendor = i386_nocpuid_cpus[cputype << 1];
+	cpu_class = i386_nocpuid_cpus[(cputype << 1) + 1];
 
 	if (cpuid_level < 0)
 		return;
@@ -767,7 +767,7 @@ cpu_identify(struct cpu_info *ci)
 	if (cpu_class == CPUCLASS_386) {
 		panic("NetBSD requires an 80486DX or later processor");
 	}
-	if (cpu == CPU_486DLC) {
+	if (cputype == CPU_486DLC) {
 		aprint_error("WARNING: BUGGY CYRIX CACHE\n");
 	}
 

Reply via email to