diff mbox

[2/3] memory: make function memory_access_is_direct public

Message ID 1437035704-11299-3-git-send-email-real@ispras.ru
State New
Headers show

Commit Message

Efimov Vasily July 16, 2015, 8:35 a.m. UTC
Make function memory_access_is_direct public. It is required by PAM emulation.

Signed-off-by: Efimov Vasily <real@ispras.ru>
---
 exec.c                         | 12 ------------
 include/exec/memory-internal.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/exec.c b/exec.c
index 4e37ded..27064b8 100644
--- a/exec.c
+++ b/exec.c
@@ -372,18 +372,6 @@  address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
     return section;
 }
 
-static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
-{
-    if (memory_region_is_ram(mr)) {
-        return !(is_write && mr->readonly);
-    }
-    if (memory_region_is_romd(mr)) {
-        return !is_write;
-    }
-
-    return false;
-}
-
 /* Called from RCU critical section */
 MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
                                       hwaddr *xlat, hwaddr *plen,
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 801da82..89975b6 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -34,5 +34,17 @@  bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
 void invalidate_and_set_dirty(MemoryRegion *mr, hwaddr addr,
                                      hwaddr length);
 
+static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
+{
+    if (memory_region_is_ram(mr)) {
+        return !(is_write && mr->readonly);
+    }
+    if (memory_region_is_romd(mr)) {
+        return !is_write;
+    }
+
+    return false;
+}
+
 #endif
 #endif