Patchwork [V3,05/11] memory: introduce ref, unref interface for MemoryRegionOps

login
register
mail settings
Submitter pingfan liu
Date Sept. 11, 2012, 7:51 a.m.
Message ID <1347349912-15611-6-git-send-email-qemulist@gmail.com>
Download mbox | patch
Permalink /patch/183057/
State New
Headers show

Comments

pingfan liu - Sept. 11, 2012, 7:51 a.m.
From: Liu Ping Fan <pingfank@linux.vnet.ibm.com>

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 <pingfank@linux.vnet.ibm.com>
---
 memory.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

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: */