From 8b80f818c647ec06d39ff104f04e78f9dfe4bcab Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Tue, 11 Jun 2024 23:29:05 +0530 Subject: [PATCH] cpu/psr(chore): minor change Signed-off-by: Amneesh Singh --- include/cpu/psr.hh | 1 - src/cpu/psr.cc | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/cpu/psr.hh b/include/cpu/psr.hh index 0e206b2..40999b5 100644 --- a/include/cpu/psr.hh +++ b/include/cpu/psr.hh @@ -115,7 +115,6 @@ class Psr { private: static constexpr uint32_t PSR_CLEAR_RESERVED = 0xF00000FF; - static constexpr uint32_t PSR_CLEAR_MODE = 0xFFFFFFE0; uint32_t psr; }; diff --git a/src/cpu/psr.cc b/src/cpu/psr.cc index 4893f64..7dc411f 100644 --- a/src/cpu/psr.cc +++ b/src/cpu/psr.cc @@ -1,6 +1,5 @@ #include "cpu/psr.hh" #include "util/bits.hh" -#include "util/log.hh" namespace matar { Psr::Psr(uint32_t raw) @@ -18,12 +17,12 @@ Psr::set_all(uint32_t raw) { Mode Psr::mode() const { - return static_cast(psr & ~PSR_CLEAR_MODE); + return static_cast(psr & 0b11111); } void Psr::set_mode(Mode mode) { - psr &= PSR_CLEAR_MODE; + psr &= 0b00000; psr |= static_cast(mode); }