fix InterruptLevel code to return the correct level
(the bit positition that is set in softint) --HG-- extra : convert_revision : ba0e1f4ec1f74aac64c3f9bb7eb1b771e17b013a
This commit is contained in:
parent
57d11578cf
commit
d8eeb2e0ff
1 changed files with 3 additions and 3 deletions
|
@ -189,10 +189,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue