summaryrefslogtreecommitdiff
path: root/src/arch/sparc/regfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/sparc/regfile.cc')
-rw-r--r--src/arch/sparc/regfile.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/sparc/regfile.cc b/src/arch/sparc/regfile.cc
index 691d0a0f1..4be411d17 100644
--- a/src/arch/sparc/regfile.cc
+++ b/src/arch/sparc/regfile.cc
@@ -255,10 +255,10 @@ int SparcISA::InterruptLevel(uint64_t softint)
if (softint & 0x10000 || softint & 0x1)
return 14;
- int level = 14;
- while (level >= 0 && !(1 << (level + 1) & softint))
+ int level = 15;
+ while (level > 0 && !(1 << level & softint))
level--;
- if (1 << (level + 1) & softint)
+ if (1 << level & softint)
return level;
return 0;
}