[query] add UC_QUERY_PAGE_SIZE uc_query helper
Return the current page size used by the current arch. Useful to call uc_mem_map() with memory/size aligned. Signed-off-by: Nicolas PLANEL <nplanel@redhat.com>
This commit is contained in:
5
uc.c
5
uc.c
@@ -1094,6 +1094,11 @@ uint32_t uc_mem_regions(uc_engine *uc, uc_mem_region **regions, uint32_t *count)
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_query(uc_engine *uc, uc_query_type type, size_t *result)
|
||||
{
|
||||
if (type == UC_QUERY_PAGE_SIZE) {
|
||||
*result = uc->target_page_size;
|
||||
return UC_ERR_OK;
|
||||
}
|
||||
|
||||
switch(uc->arch) {
|
||||
case UC_ARCH_ARM:
|
||||
return uc->query(uc, type, result);
|
||||
|
||||
Reference in New Issue
Block a user