From 0db3db91302876adc4490b9c3c1ff10945b38044 Mon Sep 17 00:00:00 2001 From: Missy Connell Date: Mon, 29 Oct 2012 13:55:23 -0500 Subject: 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 --- src/kernel/cpumgr.C | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src/kernel/cpumgr.C') 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 #include #include +#include +#include +#include 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(); + +} -- cgit v1.2.1