From: Kajol Jain Date: Wed, 12 Jun 2019 06:05:32 +0000 (+0530) Subject: arch-power: Added Doorbell interrupt Handler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84b7b775df30aa317fa8afc0a15392b6a3081f4d;p=gem5.git 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 --- diff --git a/src/arch/power/faults.hh b/src/arch/power/faults.hh index 206f8c643..60881d783 100644 --- a/src/arch/power/faults.hh +++ b/src/arch/power/faults.hh @@ -50,7 +50,9 @@ enum pcSet SystemCallPCSet = 0xC00, ProgramPCSet = 0x700, DataStoragePCSet = 0x300, - InstrStoragePCSet = 0x400 + InstrStoragePCSet = 0x400, + PriDoorbellPCSet = 0xA00, + HypDoorbellPCSet = 0xe80 }; namespace PowerISA @@ -148,6 +150,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.