summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/tod_init/tod_init.C
diff options
context:
space:
mode:
authorvanlee <vanlee@us.ibm.com>2013-04-28 00:59:59 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-05-08 14:24:52 -0500
commit877e635c96a6c7f2d657fb8abb974417b033e282 (patch)
tree5f8fdd8bdf32117127143870aa13fc7ab7332b75 /src/usr/hwpf/hwp/tod_init/tod_init.C
parent7af1d3ab7d3ab0049032cbdb3f04fd0e773724fe (diff)
downloadblackbird-hostboot-877e635c96a6c7f2d657fb8abb974417b033e282.tar.gz
blackbird-hostboot-877e635c96a6c7f2d657fb8abb974417b033e282.zip
Port FSP TOD service module to Hostboot for SPless system
Change-Id: I9f61df4b8ea05c5634578cc8e27f5ffa7dadf8da RTC: 67846 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4250 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/hwpf/hwp/tod_init/tod_init.C')
-rw-r--r--src/usr/hwpf/hwp/tod_init/tod_init.C102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/usr/hwpf/hwp/tod_init/tod_init.C b/src/usr/hwpf/hwp/tod_init/tod_init.C
new file mode 100644
index 000000000..c67435be6
--- /dev/null
+++ b/src/usr/hwpf/hwp/tod_init/tod_init.C
@@ -0,0 +1,102 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/tod_init/tod_init.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/**
+ * @file tod_init.C
+ *
+ * HWP_IGNORE_VERSION_CHECK
+ *
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+
+#include <trace/interface.H>
+#include <errl/errlentry.H>
+#include <errl/errlmanager.H>
+#include <targeting/common/targetservice.H>
+#include "TodTrace.H"
+#include "tod_init.H"
+#include "TodSvc.H"
+
+namespace TOD
+{
+
+const char TOD_TRACE_NAME[] = "TOD";
+trace_desc_t* g_trac_tod = NULL;
+TRAC_INIT(&g_trac_tod, TOD_TRACE_NAME, KILOBYTE, TRACE::BUFFER_SLOW);
+
+static bool is_spless()
+{
+ bool spless = true;
+ TARGETING::Target * sys = NULL;
+ TARGETING::targetService().getTopLevelTarget( sys );
+ TARGETING::SpFunctions spfuncs;
+ if( sys &&
+ sys->tryGetAttr<TARGETING::ATTR_SP_FUNCTIONS>(spfuncs) &&
+ spfuncs.mailboxEnabled )
+ {
+ spless = false;
+ }
+
+ return spless;
+}
+
+void * call_tod_setup(void *dummy)
+{
+ errlHndl_t l_errl;
+
+ if (is_spless())
+ {
+ l_errl = TodSvc::getTheInstance().todSetup();
+
+ if (l_errl)
+ {
+ TOD_ERR("todSetup() return errl handle %p", l_errl);
+ errlCommit( l_errl, TOD_COMP_ID );
+ }
+ }
+
+ return NULL;
+}
+
+void * call_tod_init(void *dummy)
+{
+ errlHndl_t l_errl;
+
+ if (is_spless())
+ {
+ l_errl = TodSvc::getTheInstance().todInit();
+
+ if (l_errl)
+ {
+ TOD_ERR("todInit() return errl handle %p", l_errl);
+ errlCommit( l_errl, TOD_COMP_ID );
+ }
+ }
+
+ return NULL;
+}
+
+}; // end namespace
OpenPOWER on IntegriCloud