From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFedP-0004NW-06 for qemu-devel@nongnu.org; Thu, 16 Jul 2015 04:35:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFedK-0006iA-Eo for qemu-devel@nongnu.org; Thu, 16 Jul 2015 04:35:14 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:55534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFedK-0006gZ-85 for qemu-devel@nongnu.org; Thu, 16 Jul 2015 04:35:10 -0400 From: Efimov Vasily Date: Thu, 16 Jul 2015 11:35:03 +0300 Message-Id: <1437035704-11299-3-git-send-email-real@ispras.ru> In-Reply-To: <1437035704-11299-1-git-send-email-real@ispras.ru> References: <1437035704-11299-1-git-send-email-real@ispras.ru> Subject: [Qemu-devel] [PATCH 2/3] memory: make function memory_access_is_direct public List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Kirill Batuzov , Efimov Vasily , "Michael S. Tsirkin" Make function memory_access_is_direct public. It is required by PAM emulation. Signed-off-by: Efimov Vasily --- exec.c | 12 ------------ include/exec/memory-internal.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) 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 -- 1.9.1