Fix a couple uninitialized variables.
--HG-- extra : convert_revision : d17d28a9520524e5f56bd79beb9b2be6ce76a22f
This commit is contained in:
parent
cb172d0332
commit
50462c15aa
1 changed files with 8 additions and 7 deletions
|
@ -493,21 +493,22 @@ void doNormalFault(ThreadContext *tc, TrapType tt, bool gotoHpriv)
|
||||||
|
|
||||||
void getREDVector(Addr & PC, Addr & NPC)
|
void getREDVector(Addr & PC, Addr & NPC)
|
||||||
{
|
{
|
||||||
|
//XXX The following constant might belong in a header file.
|
||||||
const Addr RSTVAddr = 0xFFFFFFFFF0000000ULL;
|
const Addr RSTVAddr = 0xFFFFFFFFF0000000ULL;
|
||||||
PC = RSTVAddr | 0xA0;
|
PC = RSTVAddr | 0xA0;
|
||||||
NPC = PC + sizeof(MachInst);
|
NPC = PC + sizeof(MachInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getHyperVector(Addr & PC, Addr & NPC, MiscReg TT)
|
void getHyperVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT)
|
||||||
{
|
{
|
||||||
Addr HTBA ;
|
Addr HTBA = tc->readMiscReg(MISCREG_HTBA);
|
||||||
PC = (HTBA & ~mask(14)) | ((TT << 5) & mask(14));
|
PC = (HTBA & ~mask(14)) | ((TT << 5) & mask(14));
|
||||||
NPC = PC + sizeof(MachInst);
|
NPC = PC + sizeof(MachInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getPrivVector(Addr & PC, Addr & NPC, MiscReg TT, MiscReg TL)
|
void getPrivVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT, MiscReg TL)
|
||||||
{
|
{
|
||||||
Addr TBA ;
|
Addr TBA = tc->readMiscReg(MISCREG_TBA);
|
||||||
PC = (TBA & ~mask(15)) |
|
PC = (TBA & ~mask(15)) |
|
||||||
(TL > 1 ? (1 << 14) : 0) |
|
(TL > 1 ? (1 << 14) : 0) |
|
||||||
((TT << 5) & mask(14));
|
((TT << 5) & mask(14));
|
||||||
|
@ -556,17 +557,17 @@ void SparcFaultBase::invoke(ThreadContext * tc)
|
||||||
{
|
{
|
||||||
//guest_watchdog fault
|
//guest_watchdog fault
|
||||||
doNormalFault(tc, trapType(), true);
|
doNormalFault(tc, trapType(), true);
|
||||||
getHyperVector(PC, NPC, 2);
|
getHyperVector(tc, PC, NPC, 2);
|
||||||
}
|
}
|
||||||
else if(level == Hyperprivileged)
|
else if(level == Hyperprivileged)
|
||||||
{
|
{
|
||||||
doNormalFault(tc, trapType(), true);
|
doNormalFault(tc, trapType(), true);
|
||||||
getHyperVector(PC, NPC, trapType());
|
getHyperVector(tc, PC, NPC, trapType());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
doNormalFault(tc, trapType(), false);
|
doNormalFault(tc, trapType(), false);
|
||||||
getPrivVector(PC, NPC, trapType(), TL+1);
|
getPrivVector(tc, PC, NPC, trapType(), TL+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tc->setPC(PC);
|
tc->setPC(PC);
|
||||||
|
|
Loading…
Reference in a new issue