diff options
author | Ryan Buchner <ryan.buchner@arilinc.com> | 2022-04-12 12:53:18 -0700 |
---|---|---|
committer | Ryan Buchner <ryan.buchner@arilinc.com> | 2022-04-12 15:24:00 -0700 |
commit | b1e7493a652b969c3aed96628a347f683dd1af16 (patch) | |
tree | 0bf25733a36af91062acd032c5eeb4443cf8b5e0 /riscv/mmu.h | |
parent | ae7d2c3062c1a911d97444e5c6df5089a7bb52f6 (diff) | |
download | spike-b1e7493a652b969c3aed96628a347f683dd1af16.zip spike-b1e7493a652b969c3aed96628a347f683dd1af16.tar.gz spike-b1e7493a652b969c3aed96628a347f683dd1af16.tar.bz2 |
Add actually_store tag to store_func and store_slow_path
Will be used to check store attributes without actually performing the store.
Needed to AMO bug fix.
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r-- | riscv/mmu.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h index 3782ffa..deacbc4 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -147,7 +147,7 @@ public: // template for functions that store an aligned value to memory #define store_func(type, prefix, xlate_flags) \ - void prefix##_##type(reg_t addr, type##_t val) { \ + void prefix##_##type(reg_t addr, type##_t val, bool actually_store=true) { \ if (unlikely(addr & (sizeof(type##_t)-1))) \ return misaligned_store(addr, val, sizeof(type##_t), xlate_flags); \ reg_t vpn = addr >> PGSHIFT; \ @@ -167,7 +167,7 @@ public: } \ else { \ target_endian<type##_t> target_val = to_target(val); \ - store_slow_path(addr, sizeof(type##_t), (const uint8_t*)&target_val, (xlate_flags)); \ + store_slow_path(addr, sizeof(type##_t), (const uint8_t*)&target_val, (xlate_flags), actually_store); \ if (proc) WRITE_MEM(addr, val, size); \ } \ } @@ -438,7 +438,7 @@ private: // handle uncommon cases: TLB misses, page faults, MMIO tlb_entry_t fetch_slow_path(reg_t addr); void load_slow_path(reg_t addr, reg_t len, uint8_t* bytes, uint32_t xlate_flags); - void store_slow_path(reg_t addr, reg_t len, const uint8_t* bytes, uint32_t xlate_flags); + void store_slow_path(reg_t addr, reg_t len, const uint8_t* bytes, uint32_t xlate_flags, bool actually_store); bool mmio_load(reg_t addr, size_t len, uint8_t* bytes); bool mmio_store(reg_t addr, size_t len, const uint8_t* bytes); bool mmio_ok(reg_t addr, access_type type); |