diff options
-rw-r--r-- | riscv/clint.cc | 2 | ||||
-rw-r--r-- | riscv/devices.h | 6 | ||||
-rw-r--r-- | riscv/plic.cc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/riscv/clint.cc b/riscv/clint.cc index 485c997..25e45fb 100644 --- a/riscv/clint.cc +++ b/riscv/clint.cc @@ -3,7 +3,7 @@ #include "processor.h" #include "simif.h" -clint_t::clint_t(simif_t* sim, uint64_t freq_hz, bool real_time) +clint_t::clint_t(const simif_t* sim, uint64_t freq_hz, bool real_time) : sim(sim), freq_hz(freq_hz), real_time(real_time), mtime(0) { struct timeval base; diff --git a/riscv/devices.h b/riscv/devices.h index fe19f74..11cc347 100644 --- a/riscv/devices.h +++ b/riscv/devices.h @@ -58,7 +58,7 @@ class mem_t : public abstract_device_t { class clint_t : public abstract_device_t { public: - clint_t(simif_t*, uint64_t freq_hz, bool real_time); + clint_t(const simif_t*, uint64_t freq_hz, bool real_time); bool load(reg_t addr, size_t len, uint8_t* bytes) override; bool store(reg_t addr, size_t len, const uint8_t* bytes) override; size_t size() { return CLINT_SIZE; } @@ -69,7 +69,7 @@ class clint_t : public abstract_device_t { typedef uint64_t mtime_t; typedef uint64_t mtimecmp_t; typedef uint32_t msip_t; - simif_t* sim; + const simif_t* sim; uint64_t freq_hz; bool real_time; uint64_t real_time_ref_secs; @@ -97,7 +97,7 @@ struct plic_context_t { class plic_t : public abstract_device_t, public abstract_interrupt_controller_t { public: - plic_t(simif_t*, uint32_t ndev); + plic_t(const simif_t*, uint32_t ndev); bool load(reg_t addr, size_t len, uint8_t* bytes) override; bool store(reg_t addr, size_t len, const uint8_t* bytes) override; void set_interrupt_level(uint32_t id, int lvl) override; diff --git a/riscv/plic.cc b/riscv/plic.cc index 37a5f53..e2685a9 100644 --- a/riscv/plic.cc +++ b/riscv/plic.cc @@ -70,7 +70,7 @@ #define REG_SIZE 0x1000000 -plic_t::plic_t(simif_t* sim, uint32_t ndev) +plic_t::plic_t(const simif_t* sim, uint32_t ndev) : num_ids(ndev + 1), num_ids_word(((ndev + 1) + (32 - 1)) / 32), max_prio((1UL << PLIC_PRIO_BITS) - 1), priority{}, level{} { |