cpu/psr(chore): minor change
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
@@ -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<Mode>(psr & ~PSR_CLEAR_MODE);
|
||||
return static_cast<Mode>(psr & 0b11111);
|
||||
}
|
||||
|
||||
void
|
||||
Psr::set_mode(Mode mode) {
|
||||
psr &= PSR_CLEAR_MODE;
|
||||
psr &= 0b00000;
|
||||
psr |= static_cast<uint32_t>(mode);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user