rename the global variable "cpu" to "cputype" to avoid conflicting with

dtrace, which wants to use "cpu" as a local variable.
This commit is contained in:
chs 2012-06-16 17:30:18 +00:00
parent 8df5dadc39
commit 4eb0eda427
4 changed files with 19 additions and 19 deletions

View File

@ -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'

View File

@ -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.99 2012/04/19 18:07:05 jym Exp $");
*/
.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 flag; does not exist on early 486s. */
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. */

View File

@ -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[];

View File

@ -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");
}