summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/baseinitsvc
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2013-09-19 12:50:27 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-08 21:33:53 -0500
commitfc5719ef7796c39c5e6c8abad6391dd311c9126c (patch)
tree67311300b63fc5086f7c5c69efb272ebe3c82360 /src/usr/initservice/baseinitsvc
parente588a94e039ad1a02fc366f371471d65337369fa (diff)
downloadblackbird-hostboot-fc5719ef7796c39c5e6c8abad6391dd311c9126c.tar.gz
blackbird-hostboot-fc5719ef7796c39c5e6c8abad6391dd311c9126c.zip
Implement termination from fatal error log.
Change-Id: Ie83f0876887ee0465cd4d430fa4a335f6aa396ec RTC:35268 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6403 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/baseinitsvc')
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.C46
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.H12
2 files changed, 58 insertions, 0 deletions
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C
index e3ca0160b..bf72d7179 100644
--- a/src/usr/initservice/baseinitsvc/initservice.C
+++ b/src/usr/initservice/baseinitsvc/initservice.C
@@ -615,6 +615,52 @@ void InitService::registerBlock(void* i_vaddr, uint64_t i_size,
}
}
+
+void Shutdown(uint64_t i_status )
+{
+ void * plid = new uint64_t;
+
+ *((uint64_t *)plid) = i_status;
+
+ // spawn a detached thread to handle the shutdown
+ // request - need to do this because the initservice
+ // is going to try and send a sync message to the errl
+ // manager to shutdown
+ tid_t l_tid = task_create(
+ &InitService::Shutdown, plid );
+
+ TRACFCOMP( g_trac_initsvc,
+ INFO_MRK"shutdown tid=%d", l_tid );
+
+}
+
+void * InitService::Shutdown( void * i_args )
+{
+
+ TRACFCOMP( g_trac_initsvc, ENTER_MRK"Shutdown()" );
+
+ // detach the process from the calling process.
+ task_detach();
+
+ uint64_t plid = *(reinterpret_cast<uint64_t*>(i_args));
+
+ TRACDCOMP( g_trac_initsvc, "plid 0x%x", plid );
+ // request a shutdown, passing in the terminating
+ // error plid as the status.
+ INITSERVICE::doShutdown( plid );
+
+ // delete the storage for the plid;
+ delete ((uint64_t *)i_args);
+
+ i_args = NULL;
+
+ TRACFCOMP( g_trac_initsvc, EXIT_MRK"Shutdown()" );
+
+ return i_args;
+}
+
+
+
void doShutdown ( uint64_t i_status,
uint64_t i_payload_base,
uint64_t i_payload_entry,
diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H
index 795afae27..4b48d528f 100644
--- a/src/usr/initservice/baseinitsvc/initservice.H
+++ b/src/usr/initservice/baseinitsvc/initservice.H
@@ -219,6 +219,18 @@ public:
uint64_t i_payload_entry = 0,
uint64_t i_payload_data = 0);
+ /**
+ * @brief Creates detatched thread and calls doShutdown
+ *
+ * @param[in] i_status - Shutdown status to be passed along on shutdown
+ *
+ * @return Nothing
+ * @note Added to enable errl manager to continue to run in termination
+ * path
+ */
+
+static void * Shutdown( void * io_args );
+
protected:
OpenPOWER on IntegriCloud