summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/plat/fapiPlatSystemConfig.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/hwpf/plat/fapiPlatSystemConfig.C')
-rw-r--r--src/usr/hwpf/plat/fapiPlatSystemConfig.C81
1 files changed, 74 insertions, 7 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatSystemConfig.C b/src/usr/hwpf/plat/fapiPlatSystemConfig.C
index f96ab4a8d..5ba76f620 100644
--- a/src/usr/hwpf/plat/fapiPlatSystemConfig.C
+++ b/src/usr/hwpf/plat/fapiPlatSystemConfig.C
@@ -33,7 +33,7 @@
#include <fapiPlatReasonCodes.H>
#include <errl/errlentry.H>
#include <targeting/common/targetservice.H>
-#include <targeting/common/predicates/predicates.H>
+#include <targeting/common/predicates/predicatectm.H>
extern "C"
{
@@ -127,12 +127,35 @@ fapi::ReturnCode fapiGetChildChiplets(
}
}
- if (!l_rc)
+ do
{
+ if (l_rc)
+ {
+ break;
+ }
+
// Extract the HostBoot Target pointer for the input chip
TARGETING::Target * l_pChip =
reinterpret_cast<TARGETING::Target*>(i_chip.get());
+ if (l_pChip == NULL)
+ {
+ /*@
+ * @errortype
+ * @moduleid MOD_FAPI_GET_CHILD_CHIPLETS
+ * @reasoncode RC_EMBEDDED_NULL_TARGET_PTR
+ * @devdesc fapi target has embedded null target pointer
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_CHILD_CHIPLETS,
+ fapi::RC_EMBEDDED_NULL_TARGET_PTR);
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+ break;
+ }
+
// Create a vector of TARGETING::Target pointers
TARGETING::TargetHandleList l_chipletList;
@@ -149,7 +172,7 @@ fapi::ReturnCode fapiGetChildChiplets(
reinterpret_cast<void *>(l_chipletList[i]));
o_chiplets.push_back(l_chiplet);
}
- }
+ } while(0);
FAPI_INF(EXIT_MRK "fapiGetChildChiplets. %d results", o_chiplets.size());
return l_rc;
@@ -181,11 +204,30 @@ fapi::ReturnCode fapiGetAssociatedDimms(
// Create a vector of TARGETING::Target pointers
TARGETING::TargetHandleList l_dimmList;
- // Get associated dimms
- TARGETING::targetService().
+ if (l_pTarget == NULL)
+ {
+ /*@
+ * @errortype
+ * @moduleid MOD_FAPI_GET_ASSOCIATE_DIMMS
+ * @reasoncode RC_EMBEDDED_NULL_TARGET_PTR
+ * @devdesc fapi target has embedded null target pointer
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_ASSOCIATE_DIMMS,
+ fapi::RC_EMBEDDED_NULL_TARGET_PTR);
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+ }
+ else
+ {
+ // Get associated dimms
+ TARGETING::targetService().
getAssociated(l_dimmList, l_pTarget,
TARGETING::TargetService::CHILD_BY_AFFINITY,
TARGETING::TargetService::ALL, &l_predicate);
+ }
// Return fapi::Targets to the caller
for (uint32_t i = 0; i < l_dimmList.size(); i++)
@@ -232,8 +274,15 @@ fapi::ReturnCode fapiGetParentChip(
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
- else
+
+ do
{
+
+ if (l_rc)
+ {
+ break;
+ }
+
// Create a Class/Type/Model predicate to look for chips
TARGETING::PredicateCTM l_predicate(TARGETING::CLASS_CHIP);
@@ -241,6 +290,24 @@ fapi::ReturnCode fapiGetParentChip(
TARGETING::Target * l_pChiplet =
reinterpret_cast<TARGETING::Target*>(i_chiplet.get());
+ if (l_pChiplet == NULL)
+ {
+ /*@
+ * @errortype
+ * @moduleid MOD_FAPI_GET_PARENT_CHIP
+ * @reasoncode RC_EMBEDDED_NULL_TARGET_PTR
+ * @devdesc fapi target has embedded null target pointer
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_PARENT_CHIP,
+ fapi::RC_EMBEDDED_NULL_TARGET_PTR);
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+ break;
+ }
+
// Create a vector of TARGETING::Target pointers
TARGETING::TargetHandleList l_chipList;
@@ -288,7 +355,7 @@ fapi::ReturnCode fapiGetParentChip(
// Set the output chip (platform specific) handle
o_chip.set(reinterpret_cast<void *>(l_chipList[0]));
}
- }
+ } while(0);
FAPI_INF(EXIT_MRK "fapiGetParentChip");
return l_rc;
OpenPOWER on IntegriCloud