Make sure only real bits of pstate can be set.
--HG-- extra : convert_revision : 8707bbed2aeb80613f86503e92b63853767adaa9
This commit is contained in:
parent
a0287c1e2d
commit
b4a31cb8b5
1 changed files with 7 additions and 2 deletions
|
@ -62,6 +62,11 @@ string SparcISA::getMiscRegName(RegIndex index)
|
||||||
return miscRegName[index];
|
return miscRegName[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum RegMask
|
||||||
|
{
|
||||||
|
PSTATE_MASK = (((1 << 4) - 1) << 1) | (((1 << 4) - 1) << 6) | (1 << 12)
|
||||||
|
};
|
||||||
|
|
||||||
void MiscRegFile::reset()
|
void MiscRegFile::reset()
|
||||||
{
|
{
|
||||||
y = 0;
|
y = 0;
|
||||||
|
@ -275,7 +280,7 @@ void MiscRegFile::setReg(int miscReg, const MiscReg &val)
|
||||||
tba = val & ULL(~0x7FFF);
|
tba = val & ULL(~0x7FFF);
|
||||||
break;
|
break;
|
||||||
case MISCREG_PSTATE:
|
case MISCREG_PSTATE:
|
||||||
pstate = val;
|
pstate = (val & PSTATE_MASK);
|
||||||
break;
|
break;
|
||||||
case MISCREG_TL:
|
case MISCREG_TL:
|
||||||
tl = val;
|
tl = val;
|
||||||
|
@ -377,7 +382,7 @@ void MiscRegFile::setRegWithEffect(int miscReg,
|
||||||
//Set up performance counting based on pcr value
|
//Set up performance counting based on pcr value
|
||||||
break;
|
break;
|
||||||
case MISCREG_PSTATE:
|
case MISCREG_PSTATE:
|
||||||
pstate = val;
|
pstate = val & PSTATE_MASK;
|
||||||
setImplicitAsis();
|
setImplicitAsis();
|
||||||
return;
|
return;
|
||||||
case MISCREG_TL:
|
case MISCREG_TL:
|
||||||
|
|
Loading…
Reference in a new issue