From f9b72476fd948cde713f145834fba81574b0fde0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 27 Apr 2019 20:37:44 -0700 Subject: [PATCH] alpha: Implement HWREI in the ISA. This moves it out of generic interfaces and the CPU implementations. Change-Id: I6767d6b26d0ae128b5bdad5830dce838be74e256 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18431 Reviewed-by: Andreas Sandberg Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/alpha/isa/decoder.isa | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/arch/alpha/isa/decoder.isa b/src/arch/alpha/isa/decoder.isa index 8789fa905..5635d381a 100644 --- a/src/arch/alpha/isa/decoder.isa +++ b/src/arch/alpha/isa/decoder.isa @@ -930,7 +930,24 @@ decode OPCODE default Unknown::unknown() { 0x1e: decode PALMODE { 0: OpcdecFault::hw_rei(); format BasicOperate { - 1: hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore); + 1: hw_rei({{ + Addr pc = PC; + if (!(pc & 0x3)) + return std::make_shared(); + + LockFlag = false; + NPC = IprExcAddr; + + ThreadContext *tc = xc->tcBase(); + auto *base_stats = tc->getKernelStats(); + auto *stats = dynamic_cast( + base_stats); + assert(stats || !base_stats); + if (stats) + stats->hwrei(); + + CPA::cpa()->swAutoBegin(tc, IprExcAddr); + }}, IsSerializing, IsSerializeBefore); } } -- 2.30.2