From 0cb1d09186e459d199bd7277aadce6d9d6117d12 Mon Sep 17 00:00:00 2001 From: kajoljain379 Date: Sat, 12 Jan 2019 14:13:02 +0530 Subject: [PATCH] arch-power: Added SystemCall Interrupt handler Added system call interrupt handler. Added handler calling in decoder file. Change-Id: I80b99257fe4b96a1a286f17afcec28bb8a849b83 Signed-off-by: kajoljain379 --- src/arch/power/faults.hh | 17 +++++++++++++++++ src/arch/power/isa/decoder.isa | 12 ++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) 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({{ }}); } -- 2.30.2