This commit is contained in:
Nguyen Anh Quynh 2015-08-24 00:52:00 +08:00
parent 3e5ebc58a0
commit f9b9dfbce9
2 changed files with 2 additions and 1 deletions

View file

@ -392,6 +392,7 @@ uc_err uc_hook_del(uch handle, uch *h2);
@handle: handle returned by uc_open()
@address: starting address of the new memory region to be mapped in.
This address will be round down to 8KB boundary
@size: size of the new memory region to be mapped in. This will be round up to
the next 8KB boundary.

2
uc.c
View file

@ -553,7 +553,7 @@ uc_err uc_mem_map(uch handle, uint64_t address, size_t size)
return UC_ERR_UCH;
// align to 8KB boundary
map_begin[map_count] = address & (~ (8*1024));
map_begin[map_count] = address & (~ (8*1024 - 1));
s = (size + 8*1024 - 1) & (~ (8*1024));
map_end[map_count] = s + map_begin[map_count];
uc->memory_map(uc, map_begin[map_count], s);