Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet reduce diff to freebsd:



details:   https://anonhg.NetBSD.org/src/rev/e6eac77711fb
branches:  trunk
changeset: 779761:e6eac77711fb
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Jun 16 17:31:47 2012 +0000

description:
reduce diff to freebsd:
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way.  this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".

diffstat:

 external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c  |   6 +-
 external/cddl/osnet/dev/dtrace/dtrace_debug.c       |  10 +-
 external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c   |   6 +-
 external/cddl/osnet/dev/fbt/fbt.c                   |  12 +-
 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c |  66 ++++++++++----------
 5 files changed, 50 insertions(+), 50 deletions(-)

diffs (truncated from 375 to 300 lines):

diff -r 2137fa1c147f -r e6eac77711fb external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c
--- a/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c        Sat Jun 16 17:30:18 2012 +0000
+++ b/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c        Sat Jun 16 17:31:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtrace_subr.c,v 1.6 2012/06/11 15:18:05 chs Exp $      */
+/*     $NetBSD: dtrace_subr.c,v 1.7 2012/06/16 17:31:47 chs Exp $      */
 
 /*
  * CDDL HEADER START
@@ -129,11 +129,11 @@
 }
 
 void
-dtrace_xcall(processorid_t xcpu, dtrace_xcall_t func, void *arg)
+dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg)
 {
        uint64_t where;
 
-       if (xcpu == DTRACE_CPUALL) {
+       if (cpu == DTRACE_CPUALL) {
                where = xc_broadcast(0, xcall_func, func, arg);
        } else {
                struct cpu_info *cinfo = cpu_lookup(cpu);
diff -r 2137fa1c147f -r e6eac77711fb external/cddl/osnet/dev/dtrace/dtrace_debug.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_debug.c     Sat Jun 16 17:30:18 2012 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_debug.c     Sat Jun 16 17:31:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtrace_debug.c,v 1.4 2011/08/31 21:57:16 christos Exp $        */
+/*     $NetBSD: dtrace_debug.c,v 1.5 2012/06/16 17:31:47 chs 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 xcpu)
+dtrace_debug_lock(int cpu)
 {
-       while (dtrace_cmpset_long(&dtrace_debug_flag[xcpu], 0, 1) == 0)
+       while (dtrace_cmpset_long(&dtrace_debug_flag[cpu], 0, 1) == 0)
                /* Loop until the lock is obtained. */
                ;
 }
 
 static void
-dtrace_debug_unlock(int xcpu)
+dtrace_debug_unlock(int cpu)
 {
-       dtrace_debug_flag[xcpu] = 0;
+       dtrace_debug_flag[cpu] = 0;
 }
 
 static void
diff -r 2137fa1c147f -r e6eac77711fb external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c
--- a/external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c Sat Jun 16 17:30:18 2012 +0000
+++ b/external/cddl/osnet/dev/dtrace/i386/dtrace_subr.c Sat Jun 16 17:31:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtrace_subr.c,v 1.6 2011/09/09 17:48:39 christos Exp $ */
+/*     $NetBSD: dtrace_subr.c,v 1.7 2012/06/16 17:31:47 chs Exp $      */
 
 /*
  * CDDL HEADER START
@@ -131,11 +131,11 @@
 }
 
 void
-dtrace_xcall(processorid_t xcpu, dtrace_xcall_t func, void *arg)
+dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg)
 {
        uint64_t where;
 
-       if (xcpu == DTRACE_CPUALL) {
+       if (cpu == DTRACE_CPUALL) {
                where = xc_broadcast(0, xcall_func, func, arg);
        } else {
                struct cpu_info *cinfo = cpu_lookup(cpu);
diff -r 2137fa1c147f -r e6eac77711fb external/cddl/osnet/dev/fbt/fbt.c
--- a/external/cddl/osnet/dev/fbt/fbt.c Sat Jun 16 17:30:18 2012 +0000
+++ b/external/cddl/osnet/dev/fbt/fbt.c Sat Jun 16 17:31:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fbt.c,v 1.10 2011/10/19 10:55:50 yamt Exp $    */
+/*     $NetBSD: fbt.c,v 1.11 2012/06/16 17:31:47 chs Exp $     */
 
 /*
  * CDDL HEADER START
@@ -182,7 +182,7 @@
 static int
 fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval)
 {
-       solaris_cpu_t *xcpu = &solaris_cpu[cpu_number()];
+       solaris_cpu_t *cpu = &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);
-                               xcpu->cpu_dtrace_caller = stack[i++];
+                               cpu->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);
 
-                               xcpu->cpu_dtrace_caller = 0;
+                               cpu->cpu_dtrace_caller = 0;
                        } else {
 #ifdef __amd64__
                                /*
@@ -221,14 +221,14 @@
                                 * action is correct.
                                 */
                                DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
-                               xcpu->cpu_dtrace_caller = stack[0];
+                               cpu->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);
-                               xcpu->cpu_dtrace_caller = 0;
+                               cpu->cpu_dtrace_caller = 0;
                        }
 
                        return (fbt->fbtp_rval);
diff -r 2137fa1c147f -r e6eac77711fb external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sat Jun 16 17:30:18 2012 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sat Jun 16 17:31:47 2012 +0000
@@ -1443,7 +1443,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, xcpu = me;
+       processorid_t me = curcpu_id, cpu = me;
        dtrace_dstate_percpu_t *dcpu = &dstate->dtds_percpu[me];
        size_t bucket, ksize;
        size_t chunksize = dstate->dtds_chunksize;
@@ -1749,8 +1749,8 @@
                                case DTRACE_DSTATE_CLEAN: {
                                        void *sp = &dstate->dtds_state;
 
-                                       if (++xcpu >= NCPU)
-                                               xcpu = 0;
+                                       if (++cpu >= NCPU)
+                                               cpu = 0;
 
                                        if (dcpu->dtdsc_dirty != NULL &&
                                            nstate == DTRACE_DSTATE_EMPTY)
@@ -1759,9 +1759,9 @@
                                        if (dcpu->dtdsc_rinsing != NULL)
                                                nstate = DTRACE_DSTATE_RINSING;
 
-                                       dcpu = &dstate->dtds_percpu[xcpu];
-
-                                       if (xcpu != me)
+                                       dcpu = &dstate->dtds_percpu[cpu];
+
+                                       if (cpu != me)
                                                goto retry;
 
                                        (void) dtrace_cas32(sp,
@@ -2325,7 +2325,7 @@
  * to the state transition diagram outlined in <sys/dtrace_impl.h>
  */
 static void
-dtrace_speculation_commit(dtrace_state_t *state, processorid_t xcpu,
+dtrace_speculation_commit(dtrace_state_t *state, processorid_t cpu,
     dtrace_specid_t which)
 {
        dtrace_speculation_t *spec;
@@ -2338,13 +2338,13 @@
                return;
 
        if (which > state->dts_nspeculations) {
-               cpu_core[xcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
+               cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
                return;
        }
 
        spec = &state->dts_speculations[which - 1];
-       src = &spec->dtsp_buffer[xcpu];
-       dest = &state->dts_buffer[xcpu];
+       src = &spec->dtsp_buffer[cpu];
+       dest = &state->dts_buffer[cpu];
 
        do {
                current = spec->dtsp_state;
@@ -2463,7 +2463,7 @@
  * according to the state transition diagram outlined in <sys/dtrace_impl.h>
  */
 static void
-dtrace_speculation_discard(dtrace_state_t *state, processorid_t xcpu,
+dtrace_speculation_discard(dtrace_state_t *state, processorid_t cpu,
     dtrace_specid_t which)
 {
        dtrace_speculation_t *spec;
@@ -2474,12 +2474,12 @@
                return;
 
        if (which > state->dts_nspeculations) {
-               cpu_core[xcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
+               cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP;
                return;
        }
 
        spec = &state->dts_speculations[which - 1];
-       buf = &spec->dtsp_buffer[xcpu];
+       buf = &spec->dtsp_buffer[cpu];
 
        do {
                current = spec->dtsp_state;
@@ -2525,8 +2525,8 @@
 dtrace_speculation_clean_here(dtrace_state_t *state)
 {
        dtrace_icookie_t cookie;
-       processorid_t xcpu = curcpu_id;
-       dtrace_buffer_t *dest = &state->dts_buffer[xcpu];
+       processorid_t cpu = curcpu_id;
+       dtrace_buffer_t *dest = &state->dts_buffer[cpu];
        dtrace_specid_t i;
 
        cookie = dtrace_interrupt_disable();
@@ -2538,7 +2538,7 @@
 
        for (i = 0; i < state->dts_nspeculations; i++) {
                dtrace_speculation_t *spec = &state->dts_speculations[i];
-               dtrace_buffer_t *src = &spec->dtsp_buffer[xcpu];
+               dtrace_buffer_t *src = &spec->dtsp_buffer[cpu];
 
                if (src->dtb_tomax == NULL)
                        continue;
@@ -2554,7 +2554,7 @@
                if (src->dtb_offset == 0)
                        continue;
 
-               dtrace_speculation_commit(state, xcpu, i + 1);
+               dtrace_speculation_commit(state, cpu, i + 1);
        }
 
        dtrace_interrupt_enable(cookie);
@@ -10701,7 +10701,7 @@
 
 static int
 dtrace_buffer_alloc(dtrace_buffer_t *bufs, size_t size, int flags,
-    processorid_t xcpu)
+    processorid_t cpu)
 {
 #if defined(sun)
        cpu_t *cp;
@@ -10722,7 +10722,7 @@
        cp = cpu_list;
 
        do {
-               if (xcpu != DTRACE_CPUALL && xcpu != cp->cpu_id)
+               if (cpu != DTRACE_CPUALL && cpu != cp->cpu_id)
                        continue;
 
                buf = &bufs[cp->cpu_id];
@@ -10759,7 +10759,7 @@
        cp = cpu_list;
 
        do {
-               if (xcpu != DTRACE_CPUALL && xcpu != cp->cpu_id)
+               if (cpu != DTRACE_CPUALL && cpu != cp->cpu_id)
                        continue;
 
                buf = &bufs[cp->cpu_id];
@@ -10795,7 +10795,7 @@
 
        ASSERT(MUTEX_HELD(&dtrace_lock));
        for (CPU_INFO_FOREACH(cpuind, cinfo)) {
-               if (xcpu != DTRACE_CPUALL && xcpu != cpu_index(cinfo))
+               if (cpu != DTRACE_CPUALL && cpu != cpu_index(cinfo))
                        continue;
 
                buf = &bufs[cpu_index(cinfo)];
@@ -10835,7 +10835,7 @@
         * allocated before the failed allocation.
         */
        for (CPU_INFO_FOREACH(cpuind, cinfo)) {
-               if (xcpu != DTRACE_CPUALL && xcpu != cpu_index(cinfo))
+               if (cpu != DTRACE_CPUALL && cpu != cpu_index(cinfo))
                        continue;
 
                buf = &bufs[cpu_index(cinfo)];
@@ -13118,7 +13118,7 @@
 dtrace_state_buffer(dtrace_state_t *state, dtrace_buffer_t *buf, int which)
 {
        dtrace_optval_t *opt = state->dts_options, size;
-       processorid_t xcpu = 0;;
+       processorid_t cpu = 0;;
        int flags = 0, rval;
 
        ASSERT(MUTEX_HELD(&dtrace_lock));
@@ -13132,7 +13132,7 @@



Home | Main Index | Thread Index | Old Index