From owner-svn-src-all@FreeBSD.ORG Wed Apr 10 02:18:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7C89A6DB; Wed, 10 Apr 2013 02:18:18 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D894BEC; Wed, 10 Apr 2013 02:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3A2IIt4039318; Wed, 10 Apr 2013 02:18:18 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3A2IIjl039317; Wed, 10 Apr 2013 02:18:18 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304100218.r3A2IIjl039317@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Apr 2013 02:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249322 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2013 02:18:18 -0000 Author: neel Date: Wed Apr 10 02:18:17 2013 New Revision: 249322 URL: http://svnweb.freebsd.org/changeset/base/249322 Log: Change name of variable from 'rwlock' to more descriptive 'mmio_rwlock' Requested by: grehan Obtained from: NetApp Modified: head/usr.sbin/bhyve/mem.c Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Wed Apr 10 02:12:39 2013 (r249321) +++ head/usr.sbin/bhyve/mem.c Wed Apr 10 02:18:17 2013 (r249322) @@ -72,7 +72,7 @@ RB_HEAD(mmio_rb_tree, mmio_rb_range) mmi */ static struct mmio_rb_range *mmio_hint[VM_MAXCPU]; -static pthread_rwlock_t rwlock; +static pthread_rwlock_t mmio_rwlock; static int mmio_rb_range_compare(struct mmio_rb_range *a, struct mmio_rb_range *b) @@ -128,12 +128,12 @@ mmio_rb_dump(struct mmio_rb_tree *rbt) { struct mmio_rb_range *np; - pthread_rwlock_rdlock(&rwlock); + pthread_rwlock_rdlock(&mmio_rwlock); RB_FOREACH(np, mmio_rb_tree, rbt) { printf(" %lx:%lx, %s\n", np->mr_base, np->mr_end, np->mr_param.name); } - pthread_rwlock_unlock(&rwlock); + pthread_rwlock_unlock(&mmio_rwlock); } #endif @@ -167,7 +167,7 @@ emulate_mem(struct vmctx *ctx, int vcpu, struct mmio_rb_range *entry; int err; - pthread_rwlock_rdlock(&rwlock); + pthread_rwlock_rdlock(&mmio_rwlock); /* * First check the per-vCPU cache */ @@ -183,7 +183,7 @@ emulate_mem(struct vmctx *ctx, int vcpu, /* Update the per-vCPU cache */ mmio_hint[vcpu] = entry; } else if (mmio_rb_lookup(&mmio_rb_fallback, paddr, &entry)) { - pthread_rwlock_unlock(&rwlock); + pthread_rwlock_unlock(&mmio_rwlock); return (ESRCH); } } @@ -191,7 +191,7 @@ emulate_mem(struct vmctx *ctx, int vcpu, assert(entry != NULL); err = vmm_emulate_instruction(ctx, vcpu, paddr, vie, mem_read, mem_write, &entry->mr_param); - pthread_rwlock_unlock(&rwlock); + pthread_rwlock_unlock(&mmio_rwlock); return (err); } @@ -210,10 +210,10 @@ register_mem_int(struct mmio_rb_tree *rb mrp->mr_param = *memp; mrp->mr_base = memp->base; mrp->mr_end = memp->base + memp->size - 1; - pthread_rwlock_wrlock(&rwlock); + pthread_rwlock_wrlock(&mmio_rwlock); if (mmio_rb_lookup(rbt, memp->base, &entry) != 0) err = mmio_rb_add(rbt, mrp); - pthread_rwlock_unlock(&rwlock); + pthread_rwlock_unlock(&mmio_rwlock); if (err) free(mrp); } else @@ -243,7 +243,7 @@ unregister_mem(struct mem_range *memp) struct mmio_rb_range *entry = NULL; int err, i; - pthread_rwlock_wrlock(&rwlock); + pthread_rwlock_wrlock(&mmio_rwlock); err = mmio_rb_lookup(&mmio_rb_root, memp->base, &entry); if (err == 0) { mr = &entry->mr_param; @@ -257,7 +257,7 @@ unregister_mem(struct mem_range *memp) mmio_hint[i] = NULL; } } - pthread_rwlock_unlock(&rwlock); + pthread_rwlock_unlock(&mmio_rwlock); if (entry) free(entry); @@ -271,5 +271,5 @@ init_mem(void) RB_INIT(&mmio_rb_root); RB_INIT(&mmio_rb_fallback); - pthread_rwlock_init(&rwlock, NULL); + pthread_rwlock_init(&mmio_rwlock, NULL); }