diff options
author | Jerry Zhao <jerryz123@berkeley.edu> | 2022-12-28 19:59:30 -0800 |
---|---|---|
committer | Jerry Zhao <jerryz123@berkeley.edu> | 2023-01-03 10:10:01 -0800 |
commit | 43474ddc63ff52ef6a92e32889312609a770941c (patch) | |
tree | 9b1487f75a766a947b01560d94385069d8b48b77 | |
parent | 25f9028475b3b774be617a197fe76435827258b1 (diff) | |
download | riscv-isa-sim-43474ddc63ff52ef6a92e32889312609a770941c.zip riscv-isa-sim-43474ddc63ff52ef6a92e32889312609a770941c.tar.gz riscv-isa-sim-43474ddc63ff52ef6a92e32889312609a770941c.tar.bz2 |
Support pte load/store from mmio regions
-rw-r--r-- | riscv/mmu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h index 6f532c1..061c5f8 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -381,7 +381,7 @@ private: target_endian<T> target_pte; if (host_pte_paddr) { memcpy(&target_pte, host_pte_paddr, ptesize); - } else { + } else if (!mmio_load(pte_paddr, ptesize, (uint8_t*)&target_pte)) { throw_access_exception(virt, addr, trap_type); } return from_target(target_pte); @@ -398,7 +398,7 @@ private: target_endian<T> target_pte = to_target((T)new_pte); if (host_pte_paddr) { memcpy(host_pte_paddr, &target_pte, ptesize); - } else { + } else if (!mmio_store(pte_paddr, ptesize, (uint8_t*)&target_pte)) { throw_access_exception(virt, addr, trap_type); } } |