aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-05-19 18:35:44 +0100
committerAlexander Graf <agraf@suse.de>2011-06-19 04:40:05 +0200
commit6506e4f995967b1a48cc34418c77b318df92ce35 (patch)
tree6ffb6a8338385ba80ace131fbd08a872d3ae6820 /exec.c
parentcd306087e5a9ea4091071a0a41c0ea99fac60ab0 (diff)
xen: remove xen_map_block and xen_unmap_block
Replace xen_map_block with qemu_map_cache with the appropriate locking and size parameters. Replace xen_unmap_block with qemu_invalidate_entry. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/exec.c b/exec.c
index 01f33bb2bc..e11c1dd97a 100644
--- a/exec.c
+++ b/exec.c
@@ -53,6 +53,7 @@
#endif
#else /* !CONFIG_USER_ONLY */
#include "xen-mapcache.h"
+#include "trace.h"
#endif
//#define DEBUG_TB_INVALIDATE
@@ -3088,7 +3089,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
if (block->offset == 0) {
return qemu_map_cache(addr, 0, 1);
} else if (block->host == NULL) {
- block->host = xen_map_block(block->offset, block->length);
+ block->host = qemu_map_cache(block->offset, block->length, 1);
}
}
return block->host + (addr - block->offset);
@@ -3117,7 +3118,7 @@ void *qemu_safe_ram_ptr(ram_addr_t addr)
if (block->offset == 0) {
return qemu_map_cache(addr, 0, 1);
} else if (block->host == NULL) {
- block->host = xen_map_block(block->offset, block->length);
+ block->host = qemu_map_cache(block->offset, block->length, 1);
}
}
return block->host + (addr - block->offset);
@@ -3135,19 +3136,7 @@ void qemu_put_ram_ptr(void *addr)
trace_qemu_put_ram_ptr(addr);
if (xen_mapcache_enabled()) {
- RAMBlock *block;
-
- QLIST_FOREACH(block, &ram_list.blocks, next) {
- if (addr == block->host) {
- break;
- }
- }
- if (block && block->host) {
- xen_unmap_block(block->host, block->length);
- block->host = NULL;
- } else {
- qemu_invalidate_entry(addr);
- }
+ qemu_invalidate_entry(block->host);
}
}