Add uc_ctl_get/set_tcg_buffer_size

We still need this API because the virtual memory address space of

32 bits os is only 4GB and we default need 1G per instance

Credits to @ZehMatt for original idea

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
This commit is contained in:
mio
2023-06-10 23:36:02 +02:00
parent f8c7969d65
commit 8dffbc159c
6 changed files with 25 additions and 6 deletions

14
uc.c
View File

@@ -2374,6 +2374,20 @@ uc_err uc_ctl(uc_engine *uc, uc_control_type control, ...)
break;
}
case UC_CTL_TCG_BUFFER_SIZE: {
if (rw == UC_CTL_IO_WRITE) {
uint32_t size = va_arg(args, uint32_t);
uc->tcg_buffer_size = size;
} else {
UC_INIT(uc);
uint32_t *size = va_arg(args, uint32_t *);
*size = uc->tcg_buffer_size;
}
break;
}
default:
err = UC_ERR_ARG;
break;