From patchwork Mon Oct 22 09:23:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pingfank@linux.vnet.ibm.com X-Patchwork-Id: 193197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B4BC32C0100 for ; Tue, 23 Oct 2012 03:04:16 +1100 (EST) Received: from localhost ([::1]:36007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQJzW-0006cx-5P for incoming@patchwork.ozlabs.org; Mon, 22 Oct 2012 11:32:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQEFU-0002rN-4D for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:24:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQEFH-0006gF-D2 for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:24:40 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:42245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQEFG-0006fY-P3 for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:24:27 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Oct 2012 14:54:22 +0530 Received: from d28relay03.in.ibm.com (9.184.220.60) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 22 Oct 2012 14:54:20 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9M9OJYE32374848 for ; Mon, 22 Oct 2012 14:54:19 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9MEsAZ8028164 for ; Mon, 22 Oct 2012 14:54:12 GMT Received: from oc8440477808.cn.ibm.com (oc8440477808.cn.ibm.com [9.115.122.202]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9MErrUf026674; Mon, 22 Oct 2012 14:54:06 GMT From: Liu Ping Fan To: qemu-devel@nongnu.org Date: Mon, 22 Oct 2012 17:23:48 +0800 Message-Id: <1350897839-29593-6-git-send-email-pingfank@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1350897839-29593-1-git-send-email-pingfank@linux.vnet.ibm.com> References: <1350897839-29593-1-git-send-email-pingfank@linux.vnet.ibm.com> x-cbid: 12102209-9574-0000-0000-000004F7C956 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.6 X-Mailman-Approved-At: Mon, 22 Oct 2012 11:31:25 -0400 Cc: Stefan Hajnoczi , Marcelo Tosatti , Avi Kivity , Anthony Liguori , Jan Kiszka , Paolo Bonzini Subject: [Qemu-devel] [patch v4 05/16] memory: introduce ref, unref interface for MemoryRegionOps X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This pair of interface help to decide when dispatching, whether we can pin mr without big lock or not. Signed-off-by: Liu Ping Fan --- memory.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/memory.h b/memory.h index bd1bbae..9039411 100644 --- a/memory.h +++ b/memory.h @@ -25,6 +25,7 @@ #include "iorange.h" #include "ioport.h" #include "int128.h" +#include "qemu/object.h" typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegion MemoryRegion; @@ -66,6 +67,8 @@ struct MemoryRegionOps { target_phys_addr_t addr, uint64_t data, unsigned size); + int (*ref)(MemoryRegion *mr); + void (*unref)(MemoryRegion *mr); enum device_endian endianness; /* Guest-visible constraints: */