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:
Ali Saidi 2007-01-20 23:12:32 -05:00
parent 57d11578cf
commit d8eeb2e0ff

View file

@ -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;
}