qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 01/21] memory: Introduce address_space_lookup_region


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 01/21] memory: Introduce address_space_lookup_region
Date: Thu, 30 May 2013 23:16:49 +0200

From: Jan Kiszka <address@hidden>

This introduces a wrapper for phys_page_find (before we complicate
address_space_translate with IOMMU translation).

The function will also include subpage handling.

Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 exec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 5b8b40d..2cd4eb3 100644
--- a/exec.c
+++ b/exec.c
@@ -203,6 +203,12 @@ bool memory_region_is_unassigned(MemoryRegion *mr)
         && mr != &io_mem_watch;
 }
 
+static MemoryRegionSection *address_space_lookup_region(AddressSpace *as,
+                                                        hwaddr addr)
+{
+    return phys_page_find(as->dispatch, addr >> TARGET_PAGE_BITS);
+}
+
 MemoryRegionSection *address_space_translate(AddressSpace *as, hwaddr addr,
                                              hwaddr *xlat, hwaddr *plen,
                                              bool is_write)
@@ -210,7 +216,7 @@ MemoryRegionSection *address_space_translate(AddressSpace 
*as, hwaddr addr,
     MemoryRegionSection *section;
     Int128 diff;
 
-    section = phys_page_find(as->dispatch, addr >> TARGET_PAGE_BITS);
+    section = address_space_lookup_region(as, addr);
     /* Compute offset within MemoryRegionSection */
     addr -= section->offset_within_address_space;
 
-- 
1.8.1.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]