use address_space_translate to find memory mapping

first version has bugs
This commit is contained in:
Takacs, Philipp
2022-12-22 12:20:36 +01:00
parent cd85f589a2
commit 065af19dc5
22 changed files with 42 additions and 9 deletions

5
uc.c
View File

@@ -31,6 +31,7 @@
#include "qemu-common.h"
static void clear_deleted_hooks(uc_engine *uc);
static MemoryRegion *find_memory_region(struct uc_struct *uc, uint64_t address);
static void *hook_insert(struct list *l, struct hook *h)
{
@@ -1083,12 +1084,14 @@ static bool memory_overlap(struct uc_struct *uc, uint64_t begin, size_t size)
return true;
// not found
return false;
}
// common setup/error checking shared between uc_mem_map and uc_mem_map_ptr
static uc_err mem_map(uc_engine *uc, MemoryRegion *block)
{
MemoryRegion **regions;
int pos;
@@ -1609,7 +1612,7 @@ uc_err uc_mem_unmap(struct uc_struct *uc, uint64_t address, size_t size)
}
// find the memory region of this address
MemoryRegion *find_memory_region(struct uc_struct *uc, uint64_t address)
static MemoryRegion *find_memory_region(struct uc_struct *uc, uint64_t address)
{
unsigned int i;