From e9e3fdc02233adbef6ad9831cee05531f4145dac Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 27 Apr 2019 21:00:41 -0700 Subject: [PATCH] alpha: Implement simPalCheck within the ISA description. This doesn't need to be plumbed through generic interfaces. If the function/instruction got more complex in the future (unlikely since Alpha doesn't really see development these days), it could be moved to a helper function defined within Alpha files. Change-Id: Ib746fad7bb13c5cc9c6ee555c3a46ce686771c12 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18433 Tested-by: kokoro Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power --- src/arch/alpha/isa/decoder.isa | 25 ++++++++++++++++++++++++- src/arch/alpha/isa/main.isa | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/arch/alpha/isa/decoder.isa b/src/arch/alpha/isa/decoder.isa index 5635d381a..8732d70ba 100644 --- a/src/arch/alpha/isa/decoder.isa +++ b/src/arch/alpha/isa/decoder.isa @@ -858,7 +858,30 @@ decode OPCODE default Unknown::unknown() { } else { // check to see if simulator wants to do something special // on this PAL call (including maybe suppress it) - bool dopal = xc->simPalCheck(palFunc); + bool dopal = true; + ThreadContext *tc = xc->tcBase(); + auto *base_stats = tc->getKernelStats(); + auto *stats = dynamic_cast( + base_stats); + assert(stats || !base_stats); + if (stats) + stats->callpal(palFunc, tc); + + System *sys = tc->getSystemPtr(); + + switch (palFunc) { + case PAL::halt: + xc->tcBase()->halt(); + if (--System::numSystemsRunning == 0) + exitSimLoop("all cpus halted"); + break; + + case PAL::bpt: + case PAL::bugchk: + if (sys->breakpoint()) + dopal = false; + break; + } if (dopal) { xc->setMiscReg(IPR_EXC_ADDR, NPC); diff --git a/src/arch/alpha/isa/main.isa b/src/arch/alpha/isa/main.isa index f77b1f9c9..3f7e1a39a 100644 --- a/src/arch/alpha/isa/main.isa +++ b/src/arch/alpha/isa/main.isa @@ -77,6 +77,7 @@ output exec {{ #include "arch/alpha/decoder.hh" #include "arch/alpha/kernel_stats.hh" +#include "arch/alpha/osfpal.hh" #include "arch/alpha/registers.hh" #include "arch/alpha/regredir.hh" #include "arch/generic/memhelpers.hh" -- 2.30.2