From: Luke Kenneth Casson Leighton Date: Fri, 19 Oct 2018 22:44:00 +0000 (+0100) Subject: const sv_mmu_t functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f592671c2c43a81beb20c66e23f7ccb624bfe79b;p=riscv-isa-sim.git const sv_mmu_t functions --- diff --git a/riscv/sv_mmu.h b/riscv/sv_mmu.h index d42063c..b976729 100644 --- a/riscv/sv_mmu.h +++ b/riscv/sv_mmu.h @@ -13,7 +13,7 @@ public: sv_mmu_t(simif_t* sim, processor_t* proc) : mmu_t(sim, proc) {} #define sv_load_func(type) \ - inline sv_reg_t load_##type(reg_t addr) { \ + inline sv_reg_t load_##type(reg_t const& addr) { \ type##_t v = mmu_t::load_##type(addr); \ return sv_reg_t(v); \ } @@ -35,7 +35,7 @@ public: sv_load_func(int64) #define sv_store_func(type) \ - void store_##type(sv_reg_t addr, type##_t val) { \ + void store_##type(sv_reg_t const& addr, type##_t val) { \ mmu_t::store_##type(addr, val); \ } @@ -47,7 +47,7 @@ public: #define sv_amo_func(type) \ template \ - sv_reg_t amo_##type(sv_reg_t addr, sv_reg_t rhs, _op f) { \ + sv_reg_t amo_##type(sv_reg_t const& addr, sv_reg_t const& rhs, _op f) { \ type##_t v = mmu_t::amo_##type(addr, rhs, f); \ return sv_reg_t(v); \ } @@ -55,22 +55,22 @@ public: sv_amo_func(uint32) sv_amo_func(uint64) - void store_float128(sv_reg_t addr, float128_t val) + void store_float128(sv_reg_t const& addr, float128_t val) { mmu_t::store_float128(addr, val); } - float128_t load_float128(sv_reg_t addr) + float128_t load_float128(sv_reg_t const& addr) { return mmu_t::load_float128(addr); } - void acquire_load_reservation(sv_reg_t vaddr) + void acquire_load_reservation(sv_reg_t const& vaddr) { mmu_t::acquire_load_reservation(vaddr); } - bool check_load_reservation(sv_reg_t vaddr) + bool check_load_reservation(sv_reg_t const& vaddr) { return mmu_t::check_load_reservation(vaddr); }