summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/errl/errlentry.H11
-rw-r--r--src/include/usr/hwas/common/hwasCallout.H42
-rw-r--r--src/usr/errl/errlentry.C11
-rw-r--r--src/usr/hwas/common/hwasCallout.C132
-rw-r--r--src/usr/hwas/hwasPlatCallout.C119
-rw-r--r--src/usr/hwas/makefile4
6 files changed, 209 insertions, 110 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index cb7fac99a..4e9d842a4 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -55,6 +55,14 @@
#include <errl/errlud.H>
#include <hbotcompid.H>
#include <targeting/common/target.H>
+
+
+namespace ERRORLOG
+{
+class ErrlEntry;
+}
+typedef ERRORLOG::ErrlEntry* errlHndl_t;
+
#include <hwas/common/hwasCallout.H>
namespace ERRORLOG
@@ -660,7 +668,4 @@ inline void ErrlEntry::setSrcType(const srcType_t i_srcType)
} // End namespace
-typedef ERRORLOG::ErrlEntry* errlHndl_t;
-
-
#endif //ERRLENTRY_H
diff --git a/src/include/usr/hwas/common/hwasCallout.H b/src/include/usr/hwas/common/hwasCallout.H
index 5c279c4be..24f8c2adc 100644
--- a/src/include/usr/hwas/common/hwasCallout.H
+++ b/src/include/usr/hwas/common/hwasCallout.H
@@ -128,18 +128,17 @@ enum callOutPriority
* @brief processCallout process the userdetail for a callout, calling
* the deconfigure and/or GARD funcationality as appropriate
*
- * @param[in] i_errlPlid Error log PLID to store in GARD Record.
+ * @param[in] i_errl Error log handle
* @param[in] i_pData Pointer to the callout bundle
* @param[in] i_Size size of the data in the callout bundle
*
- * @return true if shutdown required, false otherwise
*/
-bool processCallout(const uint32_t i_errlPlid,
+void processCallout(errlHndl_t i_errl,
uint8_t *i_pData,
uint64_t i_Size);
// typedef for function pointer that the errlog class will use.
-typedef bool (*processCalloutFn)(const uint32_t, uint8_t *, uint64_t);
+typedef bool (*processCalloutFn)(errlHndl_t, uint8_t *, uint64_t);
#endif // not PARSER
//
@@ -165,6 +164,41 @@ typedef struct callout_ud
};
} callout_ud_t;
+/**
+ * @brief platform specific code to handle a procedure callout that has been
+ * found in an errlog
+ *
+ * @param[in] i_errl errlHndl for this errlog.
+ * @param[in] i_procedure Enum indicating which procedure to add to the
+ * error log
+ * @param[in] i_priority Enum indicating the priority of the callout
+ *
+ * @return errlHndl_t valid errlHndl_t handle if there was an error,
+ * NULL if no errors;
+ */
+errlHndl_t platHandleProcedureCallout(errlHndl_t i_errl,
+ epubProcedureID i_procedure,
+ callOutPriority i_priority);
+
+/**
+ * @brief platform specific code to handle a hardware callout that has been
+ * found in an errlog
+ *
+ * @param[in] i_pTarget target
+ * @param[in] i_priority Enum indicating the priority of the callout
+ * @param[in] i_deconfigState Enum indicating whether to deconfig or not
+ * @param[in] i_errl errlHnld for this errlog
+ * @param[in] i_gardErrType Enum indicating the type of failure
+ *
+ * @return errlHndl_t valid errlHndl_t handle if there was an error,
+ * NULL if no errors;
+ */
+errlHndl_t platHandleHWCallout(
+ TARGETING::Target *i_pTarget,
+ callOutPriority i_priority,
+ DeconfigEnum i_deconfigState,
+ errlHndl_t i_errl,
+ GARD_ErrorType i_gardErrorType);
}; // end namespace
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index f7ecefc4e..ec2fa96c5 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -337,9 +337,16 @@ uint32_t ErrlEntry::callout()
(ERRL_UDT_CALLOUT == (*it)->iv_header.iv_sst))
{
// call HWAS to have this processed
- if ((*pFn)(plid(),(*it)->iv_pData, (*it)->iv_Size))
+ (*pFn)(this,(*it)->iv_pData, (*it)->iv_Size);
+
+ // check to see if the master processor got deconfigured
+ TARGETING::Target *l_masterProc;
+ TARGETING::targetService().masterProcChipTargetHandle(
+ l_masterProc);
+ if (!l_masterProc->getAttr<TARGETING::ATTR_HWAS_STATE>().
+ functional)
{
- // if it returned true, we need to return the plid
+ // if it got deconfigured, we need to return the plid
// to indicate that we need to shutdown
l_rc = plid();
}
diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C
index 3eb884270..a536b62c4 100644
--- a/src/usr/hwas/common/hwasCallout.C
+++ b/src/usr/hwas/common/hwasCallout.C
@@ -33,6 +33,7 @@
/******************************************************************************/
#include <stdint.h>
+#include <hwas/common/hwasError.H>
#include <hwas/common/hwasCommon.H>
#include <hwas/common/deconfigGard.H>
#include <hwas/common/hwasCallout.H>
@@ -42,16 +43,17 @@
namespace HWAS
{
-bool processCallout(const uint32_t i_errlPlid,
+using namespace HWAS::COMMON;
+
+void processCallout(errlHndl_t i_errl,
uint8_t *i_pData,
uint64_t i_Size)
{
- HWAS_INF("processCallout entry. plid 0x%x data %p size %lld",
- i_errlPlid, i_pData, i_Size);
+ HWAS_INF("processCallout entry. data %p size %lld",
+ i_pData, i_Size);
- bool l_rc = false; // default is no shutdown required
callout_ud_t *pCalloutUD = (callout_ud_t *)i_pData;
- errlHndl_t errl = NULL;
+
switch (pCalloutUD->type)
{
case (HW_CALLOUT):
@@ -71,18 +73,20 @@ bool processCallout(const uint32_t i_errlPlid,
if (unlikely(pTarget == NULL))
{ // only happen if we have a corrupt errlog or targeting.
HWAS_ERR("HW callout; pTarget was NULL!!!");
-
+
/*@
* @errortype
* @moduleid HWAS::MOD_PROCESS_CALLOUT
* @reasoncode HWAS::RC_INVALID_TARGET
* @devdesc Invalid Target encountered in
- * processCallout
+ * processing of HW callout
+ * @userdata1 callout errlog PLID
*/
- errl = hwasError(
- ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ errlHndl_t errl = hwasError(
+ ERRL_SEV_INFORMATIONAL,
HWAS::MOD_PROCESS_CALLOUT,
- HWAS::RC_INVALID_TARGET);
+ HWAS::RC_INVALID_TARGET,
+ i_errl->plid());
errlCommit(errl, HWAS_COMP_ID);
break;
}
@@ -92,100 +96,31 @@ bool processCallout(const uint32_t i_errlPlid,
TARGETING::targetService().masterProcChipTargetHandle(pTarget);
}
- const DeconfigEnum deconfigState = pCalloutUD->deconfigState;
- const GARD_ErrorType gardErrorType = pCalloutUD->gardErrorType;
- //const callOutPriority priority = pCalloutUD->priority;
-
- HWAS_INF("HW callout; pTarget %p gardErrorType %x deconfigState %x",
- pTarget, gardErrorType, deconfigState);
- switch (gardErrorType)
- {
- case (GARD_NULL):
- { // means no GARD operations
- break;
- }
- default:
- {
- // move these to platform specific functions?
- // RTC: 45781
- // hostboot:
- // call HWAS common function
- errl = HWAS::theDeconfigGard().createGardRecord(*pTarget,
- i_errlPlid,
- GARD_Fatal);
- errlCommit(errl, HWAS_COMP_ID);
- // fsp:
- // RTC: 45781
- // nothing? gard record is already in PNOR
- break;
- }
- } // switch gardErrorType
-
- switch (deconfigState)
+ errlHndl_t errl = platHandleHWCallout(
+ pTarget,
+ pCalloutUD->priority,
+ pCalloutUD->deconfigState,
+ i_errl,
+ pCalloutUD->gardErrorType);
+ if (errl)
{
- case (NO_DECONFIG):
- {
- break;
- }
- case (DECONFIG):
- {
- // check to see if this target is the master processor
- TARGETING::Target *l_masterProc;
- TARGETING::targetService().masterProcChipTargetHandle(
- l_masterProc);
- if (pTarget == l_masterProc)
- {
- // if so, we can't run anymore, so we will
- // return TRUE so the caller calls doShutdown
- HWAS_ERR("callout - DECONFIG on MasterProc");
- l_rc = true;
- break;
- }
-
- // else, call HWAS common function
- errl = HWAS::theDeconfigGard().deconfigureTarget(*pTarget,
- i_errlPlid);
- errlCommit(errl, HWAS_COMP_ID);
- break;
- }
- case (DELAYED_DECONFIG):
- {
- // check to see if this target is the master processor
- TARGETING::Target *l_masterProc;
- TARGETING::targetService().masterProcChipTargetHandle(
- l_masterProc);
- if (pTarget == l_masterProc)
- {
- // if so, we can't run anymore, so we will
- // return TRUE so the caller calls doShutdown
- l_rc = true;
- HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc");
- break;
- }
- // else
- // do nothing -- the deconfig information was already
- // put on a queue and will be processed separately,
- // when the time is right.
- break;
- }
- } // switch deconfigState
+ HWAS_ERR("HW callout: error from platHandlHWCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
break;
- }
+ } // HW_CALLOUT
case (PROCEDURE_CALLOUT):
{
HWAS_INF("Procedure callout; proc 0x%x priority 0x%x",
pCalloutUD->type, pCalloutUD->type);
- //const HWAS::epubProcedureID procedure = pCalloutUD->procedure;
- //const callOutPriority priority = pCalloutUD->priority;
- // move these to platform specific functions?
- // RTC: 45781
- // hostboot:
- // nothing
-
- // fsp:
- // RTC: 45781
- // ? not sure what fsp does for procedure callouts?
+ errlHndl_t errl = platHandleProcedureCallout(i_errl,
+ pCalloutUD->procedure, pCalloutUD->priority);
+ if (errl)
+ {
+ HWAS_ERR("HW callout: error from platHandlProcedureCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
break;
}
default:
@@ -195,8 +130,7 @@ bool processCallout(const uint32_t i_errlPlid,
}
} // switch
- HWAS_INF("processCallout exit l_rc %d", l_rc);
- return l_rc;
+ HWAS_INF("processCallout exit");
} // processCallout
}; // end namespace
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
new file mode 100644
index 000000000..10d84e877
--- /dev/null
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -0,0 +1,119 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwas/hwasPlatCallout.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 hwasPlatCallout.C
+ *
+ * @brief Platform Callout specific functions
+ */
+
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasCallout.H>
+#include <hwas/common/deconfigGard.H>
+
+namespace HWAS
+{
+
+//******************************************************************************
+// platHandleProcedureCallout
+//******************************************************************************
+errlHndl_t platHandleProcedureCallout(
+ errlHndl_t i_errl,
+ epubProcedureID i_procedure,
+ callOutPriority i_priority)
+{
+ errlHndl_t errl = NULL;
+
+ // hostboot does not handle or do any action for procedure callouts
+ return errl;
+}
+
+//******************************************************************************
+// platHandleHWCallout
+//******************************************************************************
+errlHndl_t platHandleHWCallout(
+ TARGETING::Target *i_pTarget,
+ callOutPriority i_priority,
+ DeconfigEnum i_deconfigState,
+ errlHndl_t i_errl,
+ GARD_ErrorType i_gardErrorType)
+{
+ errlHndl_t errl = NULL;
+
+ HWAS_INF("HW callout; pTarget %p gardErrorType %x deconfigState %x",
+ i_pTarget, i_gardErrorType, i_deconfigState);
+ switch (i_gardErrorType)
+ {
+ case (GARD_NULL):
+ { // means no GARD operations
+ break;
+ }
+ default:
+ {
+ errl = HWAS::theDeconfigGard().createGardRecord(*i_pTarget,
+ i_errl->plid(),
+ i_gardErrorType);
+ break;
+ }
+ } // switch i_gardErrorType
+
+ switch (i_deconfigState)
+ {
+ case (NO_DECONFIG):
+ {
+ break;
+ }
+ case (DECONFIG):
+ {
+ // call HWAS common function
+ errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
+ i_errl->plid());
+ break;
+ }
+ case (DELAYED_DECONFIG):
+ {
+ // check to see if this target is the master processor
+ TARGETING::Target *l_masterProc;
+ TARGETING::targetService().masterProcChipTargetHandle(
+ l_masterProc);
+ if (i_pTarget == l_masterProc)
+ {
+ // if so, we can't run anymore, so we will
+ // call HWAS to deconfigure, forcing the issue now.
+ // TODO: RTC: 45781
+ HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc");
+ errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
+ i_errl->plid());
+ break;
+ }
+ // else
+ // do nothing -- the deconfig information was already
+ // put on a queue and will be processed separately,
+ // when the time is right.
+ break;
+ }
+ } // switch i_deconfigState
+ return errl;
+}
+
+} // namespace HWAS
diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile
index bcddfb822..047c0bd38 100644
--- a/src/usr/hwas/makefile
+++ b/src/usr/hwas/makefile
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011,2012
+# COPYRIGHT International Business Machines Corp. 2011,2013
#
# p1
#
@@ -34,7 +34,7 @@ MODULE = hwas
OBJS = hwas.o hwasCallout.o deconfigGard.o
# files in this directory
-OBJS += hwasPlat.o hostbootIstep.o hwasPlatError.o
+OBJS += hwasPlat.o hostbootIstep.o hwasPlatError.o hwasPlatCallout.o
SUBDIRS = test.d
OpenPOWER on IntegriCloud