Skip to content

Commit

Permalink
Fix checkForInt
Browse files Browse the repository at this point in the history
  • Loading branch information
llllluca committed Nov 7, 2024
1 parent 5c12bbf commit ceae987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uriscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,9 @@ void Processor::popKUIEStack() {
// otherwise, and sets CP0 registers if needed
bool Processor::checkForInt() {
// check if interrupts are enabled and pending
if (csrRead(MSTATUS) & MSTATUS_MIE_MASK && (csrRead(MIE) & csrRead(MIP))) {
uint mip = csrRead(MIE) & csrRead(MIP);
if (csrRead(MSTATUS) & MSTATUS_MIE_MASK && mip) {
uint l = 0;
uint mip = csrRead(MIP);
while (mip > 1) {
mip >>= 1;
l++;
Expand Down

0 comments on commit ceae987

Please sign in to comment.