summaryrefslogtreecommitdiffstats
path: root/src/kernel/cpumgr.C
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2012-10-29 13:55:23 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-11-09 08:51:25 -0600
commit0db3db91302876adc4490b9c3c1ff10945b38044 (patch)
tree3ec7d6bd4730420e7103bb0b6b326c01f295092d /src/kernel/cpumgr.C
parented66b035444144109e66283e4b97087b918c6b93 (diff)
downloadtalos-hostboot-0db3db91302876adc4490b9c3c1ff10945b38044.tar.gz
talos-hostboot-0db3db91302876adc4490b9c3c1ff10945b38044.zip
Terminate Immediate on a shutdown and assert
Change-Id: I37c8956afb11c69201f4936821cff5e153327780 RTC:43793 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2194 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/cpumgr.C')
-rw-r--r--src/kernel/cpumgr.C54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 162b49f41..47edb8ca2 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -39,6 +39,9 @@
#include <errno.h>
#include <kernel/deferred.H>
#include <kernel/misc.H>
+#include <kernel/terminate.H>
+#include <kernel/hbterminatetypes.H>
+#include <kernel/kernel_reasoncodes.H>
cpu_t** CpuManager::cv_cpus[KERNEL_MAX_SUPPORTED_NODES];
bool CpuManager::cv_shutdown_requested = false;
@@ -107,6 +110,16 @@ void CpuManager::requestShutdown(uint64_t i_status)
__sync_synchronize();
cv_shutdown_requested = true;
+ // If the shutdown was not called with a Good shutdown status
+ // then we know we are shutting down due to error and the
+ // status passed back is instead a PLID
+ if (i_status != SHUTDOWN_STATUS_GOOD)
+ {
+ termWritePlid(TI_SHUTDOWN, i_status);
+
+ printk("TI initiated on all threads (shutdown)\n");
+ }
+
class ExecuteShutdown : public DeferredWork
{
public:
@@ -118,6 +131,8 @@ void CpuManager::requestShutdown(uint64_t i_status)
if(c->master)
HeapManager::stats();
#endif
+
+
}
void activeMainWork()
@@ -395,3 +410,42 @@ void CpuManager::forceMemoryPeriodic()
{
cv_forcedMemPeriodic = true;
}
+
+
+void CpuManager::critAssert(uint64_t i_failAddr)
+{
+ /* create SRC amd call terminate immediate*/
+
+ termWriteSRC(TI_CRIT_ASSERT,RC_SHUTDOWN, i_failAddr);
+
+ class ExecuteCritAssert : public DeferredWork
+ {
+ public:
+ void masterPreWork()
+ {
+ // print status to the console.
+ printk("TI initiated on all threads (crit_assert)\n");
+
+ }
+
+ void activeMainWork()
+ {
+ // Call the function to perform the TI
+ terminateExecuteTI();
+ }
+
+ void nonactiveMainWork()
+ {
+ // Something wasn't synchronized correctly if we got to here.
+ // Should not have CPUs coming online while trying to execute
+ // a shutdown.
+ terminateExecuteTI();
+ }
+ };
+
+ DeferredQueue::insert(new ExecuteCritAssert());
+
+ // Force executeion of the deferred queue.
+ DeferredQueue::execute();
+
+}
OpenPOWER on IntegriCloud