diff --git a/src/core/sal/CPUState.hpp b/src/core/sal/CPUState.hpp index e1e73c61..44618941 100644 --- a/src/core/sal/CPUState.hpp +++ b/src/core/sal/CPUState.hpp @@ -20,13 +20,13 @@ public: * Gets the content of the passed Register. * @param reg the register to get the content from */ - virtual regdata_t getRegisterContent(Register* reg) const = 0; + virtual regdata_t getRegisterContent(const Register* reg) const = 0; /** * Writes the passed value into the given register. * @param reg the register that should be written to * @param value the value that should be written into the register */ - virtual void setRegisterContent(Register* reg, regdata_t value) = 0; + virtual void setRegisterContent(const Register* reg, regdata_t value) = 0; /** * Returns the current instruction pointer. * @return the current eip diff --git a/src/core/sal/bochs/BochsCPU.cc b/src/core/sal/bochs/BochsCPU.cc index d12eebd0..3ba78a35 100644 --- a/src/core/sal/bochs/BochsCPU.cc +++ b/src/core/sal/bochs/BochsCPU.cc @@ -5,7 +5,7 @@ namespace fail { -regdata_t BochsCPU::getRegisterContent(Register* reg) const +regdata_t BochsCPU::getRegisterContent(const Register* reg) const { assert(reg != NULL && "FATAL ERROR: reg-ptr cannot be NULL!"); // TODO: BX_CPU(0) *always* correct? @@ -26,7 +26,7 @@ regdata_t BochsCPU::getRegisterContent(Register* reg) const #endif // SIM_SUPPORT_64 } -void BochsCPU::setRegisterContent(Register* reg, regdata_t value) +void BochsCPU::setRegisterContent(const Register* reg, regdata_t value) { assert(reg != NULL && "FATAL ERROR: reg-ptr cannot be NULL!"); // TODO: BX_CPU(0) *always* correct? diff --git a/src/core/sal/bochs/BochsCPU.hpp b/src/core/sal/bochs/BochsCPU.hpp index a312aac0..9a0870a0 100644 --- a/src/core/sal/bochs/BochsCPU.hpp +++ b/src/core/sal/bochs/BochsCPU.hpp @@ -36,13 +36,13 @@ public: * @param reg the register pointer of interest (cannot be \c NULL) * @return the content of the register \c reg */ - regdata_t getRegisterContent(Register* reg) const; + regdata_t getRegisterContent(const Register* reg) const; /** * Sets the content of the register \c reg to \c value. * @param reg the destination register object pointer (cannot be \c NULL) * @param value the new value to assign */ - void setRegisterContent(Register* reg, regdata_t value); + void setRegisterContent(const Register* reg, regdata_t value); /** * Returns the current instruction pointer (aka program counter). * @return the current (e)ip register content diff --git a/src/core/sal/gem5/Gem5ArmCPU.cc b/src/core/sal/gem5/Gem5ArmCPU.cc index 481a38b8..fb5eb552 100644 --- a/src/core/sal/gem5/Gem5ArmCPU.cc +++ b/src/core/sal/gem5/Gem5ArmCPU.cc @@ -4,12 +4,12 @@ namespace fail { -regdata_t Gem5ArmCPU::getRegisterContent(Register* reg) const +regdata_t Gem5ArmCPU::getRegisterContent(const Register* reg) const { return GetRegisterContent(m_System, m_Id, reg->getType(), reg->getIndex()); } -void Gem5ArmCPU::setRegisterContent(Register* reg, regdata_t value) +void Gem5ArmCPU::setRegisterContent(const Register* reg, regdata_t value) { SetRegisterContent(m_System, m_Id, reg->getType(), reg->getIndex(), value); } diff --git a/src/core/sal/gem5/Gem5ArmCPU.hpp b/src/core/sal/gem5/Gem5ArmCPU.hpp index 26215502..2d0b0ffd 100644 --- a/src/core/sal/gem5/Gem5ArmCPU.hpp +++ b/src/core/sal/gem5/Gem5ArmCPU.hpp @@ -33,13 +33,13 @@ public: * @param reg the destination register whose content should be retrieved * @return the content of register \c reg */ - regdata_t getRegisterContent(Register* reg) const; + regdata_t getRegisterContent(const Register* reg) const; /** * Sets the register content for the \a current gem5 CPU. * @param reg the (initialized) register object whose content should be set * @param value the new content of the register \c reg */ - void setRegisterContent(Register* reg, regdata_t value); + void setRegisterContent(const Register* reg, regdata_t value); /** * Retrieves the current instruction pointer (IP aka program counter, PC for short) * for the current CPU \c this. diff --git a/src/core/sal/t32/T32ArmCPU.cc b/src/core/sal/t32/T32ArmCPU.cc index 1743b50a..8f8f8ed1 100644 --- a/src/core/sal/t32/T32ArmCPU.cc +++ b/src/core/sal/t32/T32ArmCPU.cc @@ -6,7 +6,7 @@ namespace fail { static const uint64_t lower = 0x00000000ffffffff; -regdata_t T32ArmCPU::getRegisterContent(Register* reg) const +regdata_t T32ArmCPU::getRegisterContent(const Register* reg) const { // T32_ReadRegister wants a mask of bits representig the registers to read: // e.g., reading R1 and R4 and R63 @@ -28,7 +28,7 @@ regdata_t T32ArmCPU::getRegisterContent(Register* reg) const return 0; // we should not come here. } -void T32ArmCPU::setRegisterContent(Register* reg, regdata_t value) +void T32ArmCPU::setRegisterContent(const Register* reg, regdata_t value) { uint64_t mask = (1 << reg->getIndex()); diff --git a/src/core/sal/t32/T32ArmCPU.hpp b/src/core/sal/t32/T32ArmCPU.hpp index 768b8017..4fc58bfb 100644 --- a/src/core/sal/t32/T32ArmCPU.hpp +++ b/src/core/sal/t32/T32ArmCPU.hpp @@ -29,13 +29,13 @@ public: * @param reg the destination register whose content should be retrieved * @return the content of register \c reg */ - regdata_t getRegisterContent(Register* reg) const; + regdata_t getRegisterContent(const Register* reg) const; /** * Sets the register content for the \a current CPU. * @param reg the (initialized) register object whose content should be set * @param value the new content of the register \c reg */ - void setRegisterContent(Register* reg, regdata_t value); + void setRegisterContent(const Register* reg, regdata_t value); /** * Retrieves the current instruction pointer (IP aka program counter, PC for short) * for the current CPU \c this.