Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet fix shadow warnings.
details: https://anonhg.NetBSD.org/src/rev/ae1fd2d88e8c
branches: trunk
changeset: 769123:ae1fd2d88e8c
user: christos <christos%NetBSD.org@localhost>
date: Wed Aug 31 21:57:16 2011 +0000
description:
fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
diffstat:
external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c | 6 +-
external/cddl/osnet/dev/dtrace/dtrace_debug.c | 24 ++--
external/cddl/osnet/dev/dtrace/dtrace_ioctl.c | 4 +-
external/cddl/osnet/dev/dtrace/dtrace_load.c | 4 +-
external/cddl/osnet/dev/fbt/fbt.c | 16 +-
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c | 94 ++++++++++----------
6 files changed, 74 insertions(+), 74 deletions(-)
diffs (truncated from 533 to 300 lines):
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c
--- a/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c Wed Aug 31 21:57:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_subr.c,v 1.4 2010/04/23 11:39:53 ahoka Exp $ */
+/* $NetBSD: dtrace_subr.c,v 1.5 2011/08/31 21:57:16 christos Exp $ */
/*
* CDDL HEADER START
@@ -129,11 +129,11 @@
}
void
-dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg)
+dtrace_xcall(processorid_t xcpu, dtrace_xcall_t func, void *arg)
{
uint64_t where;
- if (cpu == DTRACE_CPUALL) {
+ if (xcpu == DTRACE_CPUALL) {
where = xc_broadcast(0, xcall_func, func, arg);
} else {
struct cpu_info *cinfo = cpu_lookup(cpu);
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dev/dtrace/dtrace_debug.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_debug.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_debug.c Wed Aug 31 21:57:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_debug.c,v 1.3 2010/03/13 22:31:15 christos Exp $ */
+/* $NetBSD: dtrace_debug.c,v 1.4 2011/08/31 21:57:16 christos Exp $ */
/*-
* Copyright (C) 2008 John Birrell <jb%freebsd.org@localhost>.
@@ -94,17 +94,17 @@
static volatile u_long dtrace_debug_flag[MAXCPUS];
static void
-dtrace_debug_lock(int cpu)
+dtrace_debug_lock(int xcpu)
{
- while (dtrace_cmpset_long(&dtrace_debug_flag[cpu], 0, 1) == 0)
+ while (dtrace_cmpset_long(&dtrace_debug_flag[xcpu], 0, 1) == 0)
/* Loop until the lock is obtained. */
;
}
static void
-dtrace_debug_unlock(int cpu)
+dtrace_debug_unlock(int xcpu)
{
- dtrace_debug_flag[cpu] = 0;
+ dtrace_debug_flag[xcpu] = 0;
}
static void
@@ -248,21 +248,21 @@
* Put a NUL-terminated ASCII number (base <= 36) in a buffer in reverse
* order; return an optional length and a pointer to the last character
* written in the buffer (i.e., the first character of the string).
- * The buffer pointed to by `nbuf' must have length >= MAXNBUF.
+ * The buffer pointed to by `xbuf' must have length >= MAXNBUF.
*/
static char *
-dtrace_debug_ksprintn(char *nbuf, uintmax_t num, int base, int *lenp, int upper)
+dtrace_debug_ksprintn(char *xbuf, uintmax_t num, int base, int *lenp, int upper)
{
char *p, c;
- p = nbuf;
+ p = xbuf;
*p = '\0';
do {
c = hex2ascii(num % base);
*++p = upper ? toupper(c) : c;
} while (num /= base);
if (lenp)
- *lenp = p - nbuf;
+ *lenp = p - xbuf;
return (p);
}
@@ -271,7 +271,7 @@
static void
dtrace_debug_vprintf(const char *fmt, va_list ap)
{
- char nbuf[MAXNBUF];
+ char xbuf[MAXNBUF];
const char *p, *percent, *q;
u_char *up;
int ch, n;
@@ -350,7 +350,7 @@
case 'b':
num = (u_int)va_arg(ap, int);
p = va_arg(ap, char *);
- for (q = dtrace_debug_ksprintn(nbuf, num, *p++, NULL, 0); *q;)
+ for (q = dtrace_debug_ksprintn(xbuf, num, *p++, NULL, 0); *q;)
dtrace_debug__putc(*q--);
if (num == 0)
@@ -522,7 +522,7 @@
neg = 1;
num = -(intmax_t)num;
}
- p = dtrace_debug_ksprintn(nbuf, num, base, &tmp, upper);
+ p = dtrace_debug_ksprintn(xbuf, num, base, &tmp, upper);
if (sharpflag && num != 0) {
if (base == 8)
tmp++;
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dev/dtrace/dtrace_ioctl.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_ioctl.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_ioctl.c Wed Aug 31 21:57:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_ioctl.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
+/* $NetBSD: dtrace_ioctl.c,v 1.3 2011/08/31 21:57:16 christos Exp $ */
/*
* CDDL HEADER START
@@ -167,7 +167,7 @@
"DTRACEIOC_AGGSNAP":"DTRACEIOC_BUFSNAP",
cpu_number(), desc.dtbd_cpu);
- if (desc.dtbd_cpu < 0 || desc.dtbd_cpu >= ncpu)
+ if (desc.dtbd_cpu >= ncpu)
return (ENOENT);
mutex_enter(&dtrace_lock);
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dev/dtrace/dtrace_load.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_load.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_load.c Wed Aug 31 21:57:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_load.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
+/* $NetBSD: dtrace_load.c,v 1.3 2011/08/31 21:57:16 christos Exp $ */
/*
* CDDL HEADER START
@@ -81,7 +81,7 @@
dtrace_arena = vmem_create("dtrace", 1, INT_MAX, 1,
NULL, NULL, NULL, 0, VM_SLEEP, IPL_NONE);
- dtrace_state_cache = kmem_cache_create("dtrace_state_cache",
+ dtrace_state_cache = kmem_cache_create(__UNCONST("dtrace_state_cache"),
sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN,
NULL, NULL, NULL, NULL, NULL, 0);
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dev/fbt/fbt.c
--- a/external/cddl/osnet/dev/fbt/fbt.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dev/fbt/fbt.c Wed Aug 31 21:57:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fbt.c,v 1.8 2011/07/17 20:54:33 joerg Exp $ */
+/* $NetBSD: fbt.c,v 1.9 2011/08/31 21:57:16 christos Exp $ */
/*
* CDDL HEADER START
@@ -182,7 +182,7 @@
static int
fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval)
{
- solaris_cpu_t *cpu = &solaris_cpu[cpu_number()];
+ solaris_cpu_t *xcpu = &solaris_cpu[cpu_number()];
uintptr_t stack0, stack1, stack2, stack3, stack4;
fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)];
@@ -199,7 +199,7 @@
* disabled.
*/
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
- cpu->cpu_dtrace_caller = stack[i++];
+ xcpu->cpu_dtrace_caller = stack[i++];
stack0 = stack[i++];
stack1 = stack[i++];
stack2 = stack[i++];
@@ -211,7 +211,7 @@
dtrace_probe(fbt->fbtp_id, stack0, stack1,
stack2, stack3, stack4);
- cpu->cpu_dtrace_caller = 0;
+ xcpu->cpu_dtrace_caller = 0;
} else {
#ifdef __amd64__
/*
@@ -221,14 +221,14 @@
* action is correct.
*/
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
- cpu->cpu_dtrace_caller = stack[0];
+ xcpu->cpu_dtrace_caller = stack[0];
DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT |
CPU_DTRACE_BADADDR);
#endif
dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset,
rval, 0, 0, 0);
- cpu->cpu_dtrace_caller = 0;
+ xcpu->cpu_dtrace_caller = 0;
}
return (fbt->fbtp_rval);
@@ -792,12 +792,12 @@
}
static ssize_t
-fbt_get_ctt_size(uint8_t version, const ctf_type_t *tp, ssize_t *sizep,
+fbt_get_ctt_size(uint8_t xversion, const ctf_type_t *tp, ssize_t *sizep,
ssize_t *incrementp)
{
ssize_t size, increment;
- if (version > CTF_VERSION_1 &&
+ if (xversion > CTF_VERSION_1 &&
tp->ctt_size == CTF_LSIZE_SENT) {
size = CTF_TYPE_LSIZE(tp);
increment = sizeof (ctf_type_t);
diff -r 11e9355b0a19 -r ae1fd2d88e8c external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Wed Aug 31 20:21:06 2011 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Wed Aug 31 21:57:16 2011 +0000
@@ -1448,7 +1448,7 @@
uint64_t hashval = DTRACE_DYNHASH_VALID;
dtrace_dynhash_t *hash = dstate->dtds_hash;
dtrace_dynvar_t *free, *new_free, *next, *dvar, *start, *prev = NULL;
- processorid_t me = curcpu_id, cpu = me;
+ processorid_t me = curcpu_id, xcpu = me;
dtrace_dstate_percpu_t *dcpu = &dstate->dtds_percpu[me];
size_t bucket, ksize;
size_t chunksize = dstate->dtds_chunksize;
@@ -1754,8 +1754,8 @@
case DTRACE_DSTATE_CLEAN: {
void *sp = &dstate->dtds_state;
- if (++cpu >= NCPU)
- cpu = 0;
+ if (++xcpu >= NCPU)
+ xcpu = 0;
if (dcpu->dtdsc_dirty != NULL &&
nstate == DTRACE_DSTATE_EMPTY)
@@ -1764,9 +1764,9 @@
if (dcpu->dtdsc_rinsing != NULL)
nstate = DTRACE_DSTATE_RINSING;
- dcpu = &dstate->dtds_percpu[cpu];
-
- if (cpu != me)
+ dcpu = &dstate->dtds_percpu[xcpu];
+
+ if (xcpu != me)
goto retry;
(void) dtrace_cas32(sp,
@@ -2330,7 +2330,7 @@
* to the state transition diagram outlined in <sys/dtrace_impl.h>
*/
static void
-dtrace_speculation_commit(dtrace_state_t *state, processorid_t cpu,
+dtrace_speculation_commit(dtrace_state_t *state, processorid_t xcpu,
dtrace_specid_t which)
{
dtrace_speculation_t *spec;
@@ -2343,13 +2343,13 @@
return;
if (which > state->dts_nspeculations) {
- cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
+ cpu_core[xcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
return;
}
spec = &state->dts_speculations[which - 1];
- src = &spec->dtsp_buffer[cpu];
- dest = &state->dts_buffer[cpu];
+ src = &spec->dtsp_buffer[xcpu];
+ dest = &state->dts_buffer[xcpu];
do {
current = spec->dtsp_state;
@@ -2468,7 +2468,7 @@
* according to the state transition diagram outlined in <sys/dtrace_impl.h>
*/
static void
-dtrace_speculation_discard(dtrace_state_t *state, processorid_t cpu,
+dtrace_speculation_discard(dtrace_state_t *state, processorid_t xcpu,
dtrace_specid_t which)
{
dtrace_speculation_t *spec;
@@ -2479,12 +2479,12 @@
return;
if (which > state->dts_nspeculations) {
- cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
+ cpu_core[xcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
return;
}
spec = &state->dts_speculations[which - 1];
- buf = &spec->dtsp_buffer[cpu];
+ buf = &spec->dtsp_buffer[xcpu];
do {
current = spec->dtsp_state;
@@ -2530,8 +2530,8 @@
dtrace_speculation_clean_here(dtrace_state_t *state)
{
Home |
Main Index |
Thread Index |
Old Index