From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 From: Liu Ping Fan Date: Mon, 22 Oct 2012 17:23:48 +0800 Message-Id: <1350897839-29593-6-git-send-email-pingfank@linux.vnet.ibm.com> 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> Subject: [Qemu-devel] [patch v4 05/16] memory: introduce ref, unref interface for MemoryRegionOps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Marcelo Tosatti , Avi Kivity , Anthony Liguori , Jan Kiszka , Paolo Bonzini 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: */ -- 1.7.4.4