diff options
author | YenHaoChen <howard25336284@gmail.com> | 2023-01-12 08:51:36 +0800 |
---|---|---|
committer | YenHaoChen <howard25336284@gmail.com> | 2023-01-13 12:07:45 +0800 |
commit | e3efb15eca0b020ecc0c6db4e5c6ad48501a8708 (patch) | |
tree | f412f1bb4502205c84578de338e22acf8c2e1d3e /riscv | |
parent | 1fc34a04d6ee3c78d5749c79a87fee8fb43ab8ee (diff) | |
download | spike-e3efb15eca0b020ecc0c6db4e5c6ad48501a8708.zip spike-e3efb15eca0b020ecc0c6db4e5c6ad48501a8708.tar.gz spike-e3efb15eca0b020ecc0c6db4e5c6ad48501a8708.tar.bz2 |
triggers: refactor: use static and remove const for legalize_action()
Since this method does not use 'this', we turn this method into static.
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/triggers.cc | 2 | ||||
-rw-r--r-- | riscv/triggers.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/riscv/triggers.cc b/riscv/triggers.cc index 3339d38..64de725 100644 --- a/riscv/triggers.cc +++ b/riscv/triggers.cc @@ -25,7 +25,7 @@ void trigger_t::tdata2_write(processor_t UNUSED * const proc, const reg_t UNUSED tdata2 = val; } -action_t trigger_t::legalize_action(reg_t val, reg_t action_mask, reg_t dmode_mask) const noexcept { +action_t trigger_t::legalize_action(reg_t val, reg_t action_mask, reg_t dmode_mask) noexcept { reg_t act = get_field(val, action_mask); return (act > ACTION_MAXVAL || (act == ACTION_DEBUG_MODE && get_field(val, dmode_mask) == 0)) ? ACTION_DEBUG_EXCEPTION : (action_t)act; } diff --git a/riscv/triggers.h b/riscv/triggers.h index f141560..bc64c4d 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -85,7 +85,7 @@ public: virtual std::optional<match_result_t> detect_trap_match(processor_t UNUSED * const proc, const trap_t UNUSED & t) noexcept { return std::nullopt; } protected: - action_t legalize_action(reg_t val, reg_t action_mask, reg_t dmode_mask) const noexcept; + static action_t legalize_action(reg_t val, reg_t action_mask, reg_t dmode_mask) noexcept; bool common_match(processor_t * const proc) const noexcept; reg_t tdata2; |