xen: remove qemu_map_cache_unlock

There is no need for qemu_map_cache_unlock, just use
qemu_invalidate_entry instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Stefano Stabellini 2011-05-19 18:35:43 +01:00 committed by Alexander Graf
parent c13390cd38
commit cd306087e5
4 changed files with 1 additions and 39 deletions

2
exec.c
View File

@ -3146,7 +3146,7 @@ void qemu_put_ram_ptr(void *addr)
xen_unmap_block(block->host, block->length); xen_unmap_block(block->host, block->length);
block->host = NULL; block->host = NULL;
} else { } else {
qemu_map_cache_unlock(addr); qemu_invalidate_entry(addr);
} }
} }
} }

View File

@ -22,10 +22,6 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u
return qemu_get_ram_ptr(phys_addr); return qemu_get_ram_ptr(phys_addr);
} }
void qemu_map_cache_unlock(void *buffer)
{
}
ram_addr_t qemu_ram_addr_from_mapcache(void *ptr) ram_addr_t qemu_ram_addr_from_mapcache(void *ptr)
{ {
return -1; return -1;

View File

@ -230,39 +230,6 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u
return mapcache->last_address_vaddr + address_offset; return mapcache->last_address_vaddr + address_offset;
} }
void qemu_map_cache_unlock(void *buffer)
{
MapCacheEntry *entry = NULL, *pentry = NULL;
MapCacheRev *reventry;
target_phys_addr_t paddr_index;
int found = 0;
QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) {
if (reventry->vaddr_req == buffer) {
paddr_index = reventry->paddr_index;
found = 1;
break;
}
}
if (!found) {
return;
}
QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
qemu_free(reventry);
entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
while (entry && entry->paddr_index != paddr_index) {
pentry = entry;
entry = entry->next;
}
if (!entry) {
return;
}
if (entry->lock > 0) {
entry->lock--;
}
}
ram_addr_t qemu_ram_addr_from_mapcache(void *ptr) ram_addr_t qemu_ram_addr_from_mapcache(void *ptr)
{ {
MapCacheEntry *entry = NULL, *pentry = NULL; MapCacheEntry *entry = NULL, *pentry = NULL;

View File

@ -14,7 +14,6 @@
void qemu_map_cache_init(void); void qemu_map_cache_init(void);
uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, uint8_t lock); uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, uint8_t lock);
void qemu_map_cache_unlock(void *phys_addr);
ram_addr_t qemu_ram_addr_from_mapcache(void *ptr); ram_addr_t qemu_ram_addr_from_mapcache(void *ptr);
void qemu_invalidate_entry(uint8_t *buffer); void qemu_invalidate_entry(uint8_t *buffer);
void qemu_invalidate_map_cache(void); void qemu_invalidate_map_cache(void);