Avoid shadowed variables.

This commit is contained in:
christos 2005-05-29 21:33:01 +00:00
parent daaa1cae60
commit 6bbf0077fc
3 changed files with 21 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: gdt.c,v 1.33 2005/04/01 11:59:30 yamt Exp $ */
/* $NetBSD: gdt.c,v 1.34 2005/05/29 21:33:37 christos Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.33 2005/04/01 11:59:30 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.34 2005/05/29 21:33:37 christos Exp $");
#include "opt_multiprocessor.h"
@ -306,12 +306,12 @@ tss_free(int sel)
* Caller must have pmap locked for both of these functions.
*/
void
ldt_alloc(struct pmap *pmap, union descriptor *ldt, size_t len)
ldt_alloc(struct pmap *pmap, union descriptor *ldtp, size_t len)
{
int slot;
slot = gdt_get_slot();
setgdt(slot, ldt, len - 1, SDT_SYSLDT, SEL_KPL, 0, 0);
setgdt(slot, ldtp, len - 1, SDT_SYSLDT, SEL_KPL, 0, 0);
pmap->pm_ldt_sel = GSEL(slot, SEL_KPL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: identcpu.c,v 1.17 2005/02/21 15:10:51 he Exp $ */
/* $NetBSD: identcpu.c,v 1.18 2005/05/29 21:33:37 christos Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.17 2005/02/21 15:10:51 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.18 2005/05/29 21:33:37 christos Exp $");
#include "opt_cputype.h"
#include "opt_enhanced_speedstep.h"
@ -779,15 +779,15 @@ void
cpu_probe_features(struct cpu_info *ci)
{
const struct cpu_cpuid_nameclass *cpup = NULL;
int i, max, family;
int i, xmax, family;
cpu_probe_base_features(ci);
if (ci->ci_cpuid_level < 1)
return;
max = sizeof (i386_cpuid_cpus) / sizeof (i386_cpuid_cpus[0]);
for (i = 0; i < max; i++) {
xmax = sizeof (i386_cpuid_cpus) / sizeof (i386_cpuid_cpus[0]);
for (i = 0; i < xmax; i++) {
if (!strncmp((char *)ci->ci_vendor,
i386_cpuid_cpus[i].cpu_id, 12)) {
cpup = &i386_cpuid_cpus[i];
@ -1079,13 +1079,13 @@ void
identifycpu(struct cpu_info *ci)
{
const char *name, *modifier, *vendorname, *brand = "";
int class = CPUCLASS_386, vendor, i, max;
int class = CPUCLASS_386, vendor, i, xmax;
int modif, family, model;
const struct cpu_cpuid_nameclass *cpup = NULL;
const struct cpu_cpuid_family *cpufam;
char *cpuname = ci->ci_dev->dv_xname;
char buf[1024];
char *feature_str[3];
const char *feature_str[3];
if (ci->ci_cpuid_level == -1) {
#ifdef DIAGNOSTIC
@ -1101,14 +1101,14 @@ identifycpu(struct cpu_info *ci)
ci->ci_info = i386_nocpuid_cpus[cpu].cpu_info;
modifier = "";
} else {
max = sizeof (i386_cpuid_cpus) / sizeof (i386_cpuid_cpus[0]);
xmax = sizeof (i386_cpuid_cpus) / sizeof (i386_cpuid_cpus[0]);
modif = (ci->ci_signature >> 12) & 0x3;
family = CPUID2FAMILY(ci->ci_signature);
if (family < CPU_MINFAMILY)
panic("identifycpu: strange family value");
model = CPUID2MODEL(ci->ci_signature);
for (i = 0; i < max; i++) {
for (i = 0; i < xmax; i++) {
if (!strncmp((char *)ci->ci_vendor,
i386_cpuid_cpus[i].cpu_id, 12)) {
cpup = &i386_cpuid_cpus[i];

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.562 2005/04/25 15:02:05 lukem Exp $ */
/* $NetBSD: machdep.c,v 1.563 2005/05/29 21:33:01 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.562 2005/04/25 15:02:05 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.563 2005/05/29 21:33:01 christos Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -862,7 +862,7 @@ int
cpu_dump()
{
int (*dump)(dev_t, daddr_t, caddr_t, size_t);
char buf[dbtob(1)];
char bf[dbtob(1)];
kcore_seg_t *segp;
cpu_kcore_hdr_t *cpuhdrp;
phys_ram_seg_t *memsegp;
@ -874,10 +874,10 @@ cpu_dump()
return (ENXIO);
dump = bdev->d_dump;
memset(buf, 0, sizeof buf);
segp = (kcore_seg_t *)buf;
cpuhdrp = (cpu_kcore_hdr_t *)&buf[ALIGN(sizeof(*segp))];
memsegp = (phys_ram_seg_t *)&buf[ ALIGN(sizeof(*segp)) +
memset(bf, 0, sizeof bf);
segp = (kcore_seg_t *)bf;
cpuhdrp = (cpu_kcore_hdr_t *)&bf[ALIGN(sizeof(*segp))];
memsegp = (phys_ram_seg_t *)&bf[ ALIGN(sizeof(*segp)) +
ALIGN(sizeof(*cpuhdrp))];
/*
@ -900,7 +900,7 @@ cpu_dump()
memsegp[i].size = mem_clusters[i].size;
}
return (dump(dumpdev, dumplo, (caddr_t)buf, dbtob(1)));
return (dump(dumpdev, dumplo, (caddr_t)bf, dbtob(1)));
}
/*