intermediate commit, working unmap of complete blocks, still need sub-blocks, and cross block

This commit is contained in:
Chris Eagle
2015-08-29 21:17:30 -07:00
parent 160033c36c
commit 6beb1b8a13
18 changed files with 147 additions and 59 deletions

View File

@ -422,9 +422,9 @@ uc_err uc_mem_map(uch handle, uint64_t address, size_t size, uint32_t perms);
This API changes permissions on an existing memory region.
@handle: handle returned by uc_open()
@start: starting address of the memory region to be modified.
@address: starting address of the memory region to be modified.
This address must be aligned to 4KB, or this will return with UC_ERR_MAP error.
@block_size: size of the memory region to be modified.
@size: size of the memory region to be modified.
This size must be multiple of 4KB, or this will return with UC_ERR_MAP error.
@perms: New permissions for the mapped region.
This must be some combination of UC_PROT_READ | UC_PROT_WRITE | UC_PROT_EXEC,
@ -434,7 +434,23 @@ uc_err uc_mem_map(uch handle, uint64_t address, size_t size, uint32_t perms);
for detailed error).
*/
UNICORN_EXPORT
uc_err uc_mem_protect(uch handle, uint64_t start, size_t block_size, uint32_t perms);
uc_err uc_mem_protect(uch handle, uint64_t address, size_t size, uint32_t perms);
/*
Unmap a region of emulation memory.
This API deletes a memory mapping from the emulation memory space.
@handle: handle returned by uc_open()
@address: starting address of the memory region to be unmapped.
This address must be aligned to 4KB, or this will return with UC_ERR_MAP error.
@size: size of the memory region to be modified.
This size must be multiple of 4KB, or this will return with UC_ERR_MAP error.
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
for detailed error).
*/
UNICORN_EXPORT
uc_err uc_mem_unmap(uch handle, uint64_t address, size_t size);
#ifdef __cplusplus
}