|
|
|
@ -128,37 +128,37 @@ reg_t reg_from_bytes(size_t len, const uint8_t* bytes) |
|
|
|
abort(); |
|
|
|
} |
|
|
|
|
|
|
|
bool mmu_t::mmio_ok(reg_t addr, access_type UNUSED type) |
|
|
|
bool mmu_t::mmio_ok(reg_t paddr, access_type UNUSED type) |
|
|
|
{ |
|
|
|
// Disallow access to debug region when not in debug mode
|
|
|
|
if (addr >= DEBUG_START && addr <= DEBUG_END && proc && !proc->state.debug_mode) |
|
|
|
if (paddr >= DEBUG_START && paddr <= DEBUG_END && proc && !proc->state.debug_mode) |
|
|
|
return false; |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
bool mmu_t::mmio_fetch(reg_t addr, size_t len, uint8_t* bytes) |
|
|
|
bool mmu_t::mmio_fetch(reg_t paddr, size_t len, uint8_t* bytes) |
|
|
|
{ |
|
|
|
if (!mmio_ok(addr, FETCH)) |
|
|
|
if (!mmio_ok(paddr, FETCH)) |
|
|
|
return false; |
|
|
|
|
|
|
|
return sim->mmio_fetch(addr, len, bytes); |
|
|
|
return sim->mmio_fetch(paddr, len, bytes); |
|
|
|
} |
|
|
|
|
|
|
|
bool mmu_t::mmio_load(reg_t addr, size_t len, uint8_t* bytes) |
|
|
|
bool mmu_t::mmio_load(reg_t paddr, size_t len, uint8_t* bytes) |
|
|
|
{ |
|
|
|
if (!mmio_ok(addr, LOAD)) |
|
|
|
if (!mmio_ok(paddr, LOAD)) |
|
|
|
return false; |
|
|
|
|
|
|
|
return sim->mmio_load(addr, len, bytes); |
|
|
|
return sim->mmio_load(paddr, len, bytes); |
|
|
|
} |
|
|
|
|
|
|
|
bool mmu_t::mmio_store(reg_t addr, size_t len, const uint8_t* bytes) |
|
|
|
bool mmu_t::mmio_store(reg_t paddr, size_t len, const uint8_t* bytes) |
|
|
|
{ |
|
|
|
if (!mmio_ok(addr, STORE)) |
|
|
|
if (!mmio_ok(paddr, STORE)) |
|
|
|
return false; |
|
|
|
|
|
|
|
return sim->mmio_store(addr, len, bytes); |
|
|
|
return sim->mmio_store(paddr, len, bytes); |
|
|
|
} |
|
|
|
|
|
|
|
void mmu_t::check_triggers(triggers::operation_t operation, reg_t address, std::optional<reg_t> data) |
|
|
|
|