checkInterrupts(ThreadContext *tc)
{
//panic("Interrupts::checkInterrupts not implemented.\n");
- if ( tc->readIntReg(INTREG_DEC) == 0) {
+ Msr msr = tc->readIntReg(INTREG_MSR);
+ tc->setIntReg(INTREG_TB , tc->readIntReg(INTREG_TB)+1);
+ if ( tc->readIntReg(INTREG_DEC) == 0 && msr.ee) {
si = true;
return true;
}
- else {
+ else if (tc->readIntReg(INTREG_DEC) == 0 && !msr.ee) {
+ return false;
+ } else {
tc->setIntReg(INTREG_DEC , tc->readIntReg(INTREG_DEC)-1);
return false;
}
Msr msr = 0x9000000000000001;
tc->setIntReg(INTREG_DEC , 0xffffffffffffffff);
// This PVR is specific to power9
+ // Setting TB register to 0
+ tc->setIntReg(INTREG_TB , 0x0);
tc->setIntReg(INTREG_PVR , 0x004e1100);
tc->setIntReg(INTREG_MSR , msr);
//ArgumentReg0 is initialized with 0xc00000 because in linux/system.cc
//dtb is loaded at 0xc00000
tc->setIntReg(ArgumentReg0, 0x1800000);
- /* Perform a system reset */
- tc->pcState(0x100);
}