From: kajoljain379 Date: Sat, 12 Jan 2019 08:43:02 +0000 (+0530) Subject: arch-power: Added SystemCall Interrupt handler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cb1d09186e459d199bd7277aadce6d9d6117d12;p=gem5.git arch-power: Added SystemCall Interrupt handler Added system call interrupt handler. Added handler calling in decoder file. Change-Id: I80b99257fe4b96a1a286f17afcec28bb8a849b83 Signed-off-by: kajoljain379 --- diff --git a/src/arch/power/faults.hh b/src/arch/power/faults.hh index a6c7f4435..47b46cb8b 100644 --- a/src/arch/power/faults.hh +++ b/src/arch/power/faults.hh @@ -139,6 +139,23 @@ class PowerInterrupt : public PowerFaultBase }; +class SystemCallInterrupt : public PowerInterrupt +{ + public: + SystemCallInterrupt() + { + } + virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) + { + //TODO: Right now it not handle case when LEV=0. + tc->setIntReg(INTREG_SRR0 , tc->instAddr() + 4); + PowerInterrupt::updateSRR1(tc); + PowerInterrupt::updateMsr(tc); + tc->pcState(SystemCallPCSet); + } +}; + class DecrementerInterrupt : public PowerInterrupt { public: diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index 799aeb8c6..97ade360b 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -164,9 +164,17 @@ decode PO default Unknown::unknown() { } } +//TODO:Right now sc instruction not handles LEV=1 case + format IntOp { - 17: sc({{ xc->syscall(R0, &fault); }}, - [ IsSyscall, IsNonSpeculative, IsSerializeAfter ]); + 17: sc({{ + if (FullSystem) { + fault= std::make_shared(); + } else { + xc->syscall(R0, &fault); + } + }}, + [ IsSyscall, IsNonSpeculative, IsSerializeAfter ]); 2: tdi({{ }}); }