From 0317ddbcd69d913252141eb4f4d6720e0d848569 Mon Sep 17 00:00:00 2001 From: Kajol Jain Date: Wed, 12 Jun 2019 11:35:32 +0530 Subject: [PATCH] arch-power: Added Doorbell interrupt Handler Added doorbell interrupt handler of type : * Directed Hypervisor Doorbell Interrupt. * Directed Privileged Doorbell Interrupt. Change-Id: I2b2d8c07a0bbe353bf7a8279f5a02f1fe3acba87 Signed-off-by: Kajol Jain --- src/arch/power/faults.hh | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/arch/power/faults.hh b/src/arch/power/faults.hh index fc021edf6..24cfea7ec 100644 --- a/src/arch/power/faults.hh +++ b/src/arch/power/faults.hh @@ -47,7 +47,9 @@ enum pcSet SystemCallPCSet = 0xC00, ProgramPCSet = 0x700, DataStoragePCSet = 0x300, - InstrStoragePCSet = 0x400 + InstrStoragePCSet = 0x400, + PriDoorbellPCSet = 0xA00, + HypDoorbellPCSet = 0xe80 }; namespace PowerISA @@ -145,6 +147,42 @@ class PowerInterrupt : public PowerFaultBase } }; +class PriDoorbellInterrupt : public PowerInterrupt +{ + public: + PriDoorbellInterrupt() + { + } + virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) + { + tc->setIntReg(INTREG_SRR0 , tc->instAddr()); + PowerInterrupt::updateSRR1(tc); + PowerInterrupt::updateMsr(tc); + tc->pcState(PriDoorbellPCSet); + } +}; + +class HypDoorbellInterrupt : public PowerInterrupt +{ + public: + HypDoorbellInterrupt() + { + } + virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) + { + printf("In Hypervisor interrupt\n"); + tc->setIntReg(INTREG_HSRR0 , tc->instAddr()); + PowerInterrupt::updateHSRR1(tc); + PowerInterrupt::updateMsr(tc); + Msr msr = tc->readIntReg(INTREG_MSR); + msr.hv = 1; + tc->setIntReg(INTREG_MSR, msr); + tc->pcState(HypDoorbellPCSet); + } +}; + //SRR1 value is correctly set by the entity raising //Instruction Storage Interrupt. So, no need to //Update here. -- 2.30.2