aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2015-06-18 18:47:20 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-01 15:45:50 +0200
commit196ea13104f802c508e57180b2a0d2b3418989a3 (patch)
tree60167787abeca65610b7f64c5e7c8300a33982a3 /memory.c
parentafbe70535ff1a8a7a32910cc15ebecc0ba92e7da (diff)
memory: Add global-locking property to memory regions
This introduces the memory region property "global_locking". It is true by default. By setting it to false, a device model can request BQL-free dispatching of region accesses to its r/w handlers. The actual BQL break-up will be provided in a separate patch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Frederic Konrad <fred.konrad@greensocs.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1434646046-27150-4-git-send-email-pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 3ac0bd20d2..b0b8860aaa 100644
--- a/memory.c
+++ b/memory.c
@@ -1012,6 +1012,7 @@ static void memory_region_initfn(Object *obj)
mr->ram_addr = RAM_ADDR_INVALID;
mr->enabled = true;
mr->romd_mode = true;
+ mr->global_locking = true;
mr->destructor = memory_region_destructor_none;
QTAILQ_INIT(&mr->subregions);
QTAILQ_INIT(&mr->coalesced);
@@ -1646,6 +1647,16 @@ void memory_region_clear_flush_coalesced(MemoryRegion *mr)
}
}
+void memory_region_set_global_locking(MemoryRegion *mr)
+{
+ mr->global_locking = true;
+}
+
+void memory_region_clear_global_locking(MemoryRegion *mr)
+{
+ mr->global_locking = false;
+}
+
void memory_region_add_eventfd(MemoryRegion *mr,
hwaddr addr,
unsigned size,