286c286
< tc->setMiscReg(MISCREG_HPSTATE, HPSTATE);
---
> tc->setMiscRegWithEffect(MISCREG_HPSTATE, HPSTATE);
494c494
< void getREDVector(Addr & PC, Addr & NPC)
---
> void getREDVector(MiscReg TT, Addr & PC, Addr & NPC)
498c498
< PC = RSTVAddr | 0xA0;
---
> PC = RSTVAddr | ((TT << 5) & 0xFF);
521a522
> panic("Invoking a second fault!\n");
546c547
< getREDVector(PC, NPC);
---
> getREDVector(5, PC, NPC);
586,588d586
< /*
< tl = MaxTL;
< gl = MaxGL;
590,591c588,590
< tickFields.counter = 0; //The TICK register is unreadable bya
< tickFields.npt = 1; //The TICK register is unreadable by by !priv
---
> tc->setMiscReg(MISCREG_TL, MaxTL);
> tc->setMiscReg(MISCREG_TT, trapType());
> tc->setMiscRegWithEffect(MISCREG_GL, MaxGL);
593,594c592,614
< softint = 0; // Clear all the soft interrupt bits
< tick_cmprFields.int_dis = 1; // disable timer compare interrupts
---
> //Turn on pef, set everything else to 0
> tc->setMiscReg(MISCREG_PSTATE, 1 << 4);
>
> //Turn on red and hpriv, set everything else to 0
> tc->setMiscReg(MISCREG_HPSTATE, (1 << 5) | (1 << 2));
>
> //The tick register is unreadable by nonprivileged software
> tc->setMiscReg(MISCREG_TICK, 1ULL << 63);
>
> Addr PC, NPC;
> getREDVector(trapType(), PC, NPC);
> tc->setPC(PC);
> tc->setNextPC(NPC);
> tc->setNextNPC(NPC + sizeof(MachInst));
>
> //These registers are specified as "undefined" after a POR, and they
> //should have reasonable values after the miscregfile is reset
> /*
> // Clear all the soft interrupt bits
> softint = 0;
> // disable timer compare interrupts, reset tick_cmpr
> tc->setMiscReg(MISCREG_
> tick_cmprFields.int_dis = 1;
601,602d620
< pstate = 0; // fields 0 but pef
< pstateFields.pef = 1;
604,607d621
< hpstate = 0;
< hpstateFields.red = 1;
< hpstateFields.hpriv = 1;
< hpstateFields.tlz = 0; // this is a guess