Support uc_mem_protect on mmio regions

Also make mmio ranges return the correct errors on wrong protection
This commit is contained in:
2022-05-28 23:33:43 +02:00
parent 6a2e2a1291
commit 2a6529348c
4 changed files with 90 additions and 15 deletions

View File

@@ -1657,6 +1657,13 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
res = load_memop(haddr, op);
_out:
// mmio error check
if (uc->invalid_error != UC_ERR_OK) {
uc->invalid_addr = addr;
cpu_exit(uc->cpu);
return 0;
}
// Unicorn: callback on successful data read
if (!code_read) {
if (!uc->size_recur_mem) { // disabling read callback if in recursive call