summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwpf/fapi/fapiErrorInfo.H59
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCode.H98
-rw-r--r--src/usr/hwpf/fapi/fapiErrorInfo.C51
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseErrorInfo.pl165
-rw-r--r--src/usr/hwpf/fapi/fapiReturnCode.C139
-rw-r--r--src/usr/hwpf/hwp/fapiHwpErrorInfo.xml7
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C64
-rw-r--r--src/usr/hwpf/test/fapiRcTest.C278
8 files changed, 582 insertions, 279 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H
index 6fa4d404d..e3570a92d 100644
--- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H
+++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H
@@ -39,6 +39,7 @@
* structures into one
* mjjones 09/19/2012 Replace FFDC type with ID
* mjjones 03/22/2013 Support Procedure Callouts
+ * mjjones 05/20/2013 Support Bus Callouts
*/
#ifndef FAPIERRORINFO_H_
@@ -164,7 +165,37 @@ struct ErrorInfoProcedureCallout
const ProcedureCallouts::ProcedureCallout i_procedure,
const CalloutPriorities::CalloutPriority i_calloutPriority);
+ // The procedure to callout
ProcedureCallouts::ProcedureCallout iv_procedure;
+
+ // The callout priority
+ CalloutPriorities::CalloutPriority iv_calloutPriority;
+};
+
+/**
+ * @struct ErrorInfoBusCallout
+ *
+ * This struct contains a bus to callout
+ */
+struct ErrorInfoBusCallout
+{
+ /**
+ * @brief Constructor.
+ *
+ * @param[in] i_target1 Reference to target on one end of the bus
+ * @param[in] i_target2 Reference to target on other end of the bus
+ * @param[in] i_calloutPriority Priority of callout
+ */
+ ErrorInfoBusCallout(
+ const Target & i_target1,
+ const Target & i_target2,
+ const CalloutPriorities::CalloutPriority i_calloutPriority);
+
+ // The targets on each end of the bus to callout
+ Target iv_target1;
+ Target iv_target2;
+
+ // The callout priority
CalloutPriorities::CalloutPriority iv_calloutPriority;
};
@@ -179,8 +210,16 @@ struct ErrorInfoCDG
* @brief Constructor.
*
* @param[in] i_target Reference to the target to callout/deconfigure/GARD
+ * @param[in] i_callout True if Target should be called out
+ * @param[in] i_deconfigure True if Target should be deconfigured
+ * @param[in] i_gard True if Target should be GARDed
+ * @param[in] i_priority The priority of any callout
*/
- ErrorInfoCDG(const Target & i_target);
+ ErrorInfoCDG(const Target & i_target,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority);
// The target to callout/deconfigure/GARD
Target iv_target;
@@ -196,7 +235,6 @@ struct ErrorInfoCDG
bool iv_gard;
};
-
/**
* @struct ErrorInfo
*
@@ -210,16 +248,6 @@ struct ErrorInfo
*/
~ErrorInfo();
- /**
- * @brief Get a reference to the ErrorInfoCDG structure for the specified
- * Target. If there is no existing structure then one is created
- *
- * @param[in] i_target Reference to Target to get the information for
- *
- * @return Reference to ErrorInfoCDG
- */
- ErrorInfoCDG & getCreateErrorInfoCDG(const Target & i_target);
-
// Vector of FFDC Data
std::vector<ErrorInfoFfdc *> iv_ffdcs;
typedef std::vector<ErrorInfoFfdc *>::iterator ErrorInfoFfdcItr_t;
@@ -232,6 +260,13 @@ struct ErrorInfo
typedef std::vector<ErrorInfoProcedureCallout *>::const_iterator
ErrorInfoProcedureCalloutCItr_t;
+ // Vector of buses to callout
+ std::vector<ErrorInfoBusCallout *> iv_busCallouts;
+ typedef std::vector<ErrorInfoBusCallout *>::iterator
+ ErrorInfoBusCalloutItr_t;
+ typedef std::vector<ErrorInfoBusCallout *>::const_iterator
+ ErrorInfoBusCalloutCItr_t;
+
// Vector of targets to callout/deconfigure/GARD
std::vector<ErrorInfoCDG *> iv_CDGs;
typedef std::vector<ErrorInfoCDG *>::iterator ErrorInfoCDGItr_t;
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H
index 40bb55ff5..235de0206 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCode.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H
@@ -46,6 +46,7 @@
* mjjones 08/14/2012 Created getCreateReturnCodeDataRef
* mjjones 09/19/2012 Add FFDC ID to error info
* mjjones 03/22/2013 Support Procedure Callouts
+ * mjjones 05/20/2013 Support Bus Callouts
*/
#ifndef FAPIRETURNCODE_H_
@@ -280,9 +281,8 @@ public:
{
EI_TYPE_FFDC = 1,
EI_TYPE_PROCEDURE_CALLOUT = 2,
- EI_TYPE_CALLOUT = 3,
- EI_TYPE_DECONF = 4,
- EI_TYPE_GARD = 5,
+ EI_TYPE_BUS_CALLOUT = 3,
+ EI_TYPE_CDG = 4, // Target Callout/Deconfig/GARD
};
/**
@@ -293,13 +293,38 @@ public:
*/
struct ErrorInfoEntry
{
- uint8_t iv_type; // The type of ErrorInfo (from ErrorInfoType enum)
- uint8_t iv_object; // Which object in the i_pObjects array the
- // ErrorInfoEntry refers to
- int16_t iv_data1; // EI_TYPE_FFDC : Size of FFDC
- // EI_TYPE_[PROCEDURE_]CALLOUT: CalloutPriority
- uint32_t iv_data2; // EI_TYPE_FFDC : FFDC Id
- // EI_TYPE_PROCEDURE_CALLOUT : ProcedureCallout
+ uint8_t iv_type; // Value from ErrorInfoType
+ union
+ {
+ struct
+ {
+ uint8_t iv_ffdcObjIndex;
+ uint16_t iv_ffdcSize;
+ uint32_t iv_ffdcId;
+ } ffdc;
+
+ struct
+ {
+ uint8_t iv_procedure;
+ uint8_t iv_calloutPriority;
+ } proc_callout;
+
+ struct
+ {
+ uint8_t iv_endpoint1ObjIndex;
+ uint8_t iv_endpoint2ObjIndex;
+ uint8_t iv_calloutPriority;
+ } bus_callout;
+
+ struct
+ {
+ uint8_t iv_targetObjIndex;
+ uint8_t iv_callout;
+ uint8_t iv_deconfigure;
+ uint8_t iv_gard;
+ uint8_t iv_calloutPriority;
+ } target_cdg;
+ };
};
/**
@@ -313,10 +338,9 @@ public:
*
* @param[in] i_pObjects Pointer to array of const pointers to const objects
* that are referred to by ErrorInfoEntry objects
- * (object type is dependent on ErrorInfoEntry type)
* @param[in] i_pEntries Pointer to array of ErrorInfoEntry objects defining
* the ErrorInfo that needs to be added
- * @param[in] i_count Number of ErrorInfoEntry structures
+ * @param[in] i_count Number of ErrorInfoEntry entries
*/
void addErrorInfo(const void * const * i_pObjects,
const ErrorInfoEntry * i_pEntries,
@@ -380,7 +404,7 @@ private:
void forgetData();
/**
- * @brief Add a procedure to callout to the ErrorInfo
+ * @brief Add a procedure callout to the ErrorInfo
*
* This is called by addErrorInfo
*
@@ -392,34 +416,36 @@ private:
const CalloutPriorities::CalloutPriority i_priority);
/**
- * @brief Add a target to callout to the ErrorInfo
+ * @brief Add a bus callout to the ErrorInfo
*
* This is called by addErrorInfo
*
- * @param[in] i_target Reference to the target to callout.
- * @param[in] i_priority The priority of the callout
+ * @param[in] i_target1 Reference to endpoint1 Target
+ * @param[in] i_target2 Reference to endpoint2 Target
+ * @param[in] i_priority The priority of the callout
*/
- void addEICallout(
- const Target & i_target,
+ void addEIBusCallout(
+ const Target & i_target1,
+ const Target & i_target2,
const CalloutPriorities::CalloutPriority i_priority);
/**
- * @brief Add a target to deconfigure to the ErrorInfo
- *
- * This is called by addErrorInfo
- *
- * @param[in] i_target Reference to the target to deconfigure.
- */
- void addEIDeconfigure(const Target & i_target);
-
- /**
- * @brief Add a target to create a GARD record for to the ErrorInfo
+ * @brief Add a target callout/deconfigure/GARD to the ErrorInfo
*
* This is called by addErrorInfo
*
- * @param[in] i_target Reference to the target to create a GARD record for
+ * @param[in] i_target Reference to the target to cdg
+ * @param[in] i_callout True if Target should be called out
+ * @param[in] i_deconfigure True if Target should be deconfigured
+ * @param[in] i_gard True if Target should be GARDed
+ * @param[in] i_priority The priority of any callout
*/
- void addEIGard(const Target & i_target);
+ void addEICdg(
+ const Target & i_target,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority);
// The rcValue
uint32_t iv_rcValue;
@@ -443,8 +469,8 @@ namespace ReturnCodeFfdc
*/
enum ErrorInfoFfdcSize
{
- EI_FFDC_SIZE_ECMDDB = -1, // ecmdDataBufferBase
- EI_FFDC_SIZE_TARGET = -2, // fapi::Target
+ EI_FFDC_SIZE_ECMDDB = 0xffff, // ecmdDataBufferBase
+ EI_FFDC_SIZE_TARGET = 0xfffe, // fapi::Target
};
/**
@@ -455,10 +481,10 @@ namespace ReturnCodeFfdc
* than types that are simply memcopied then it is handled by a template
* specialization
*
- * @return int8_t. Size of the FFDC data
+ * @return uint16_t. Size of the FFDC data
*/
template<typename T>
- int16_t getErrorInfoFfdcSize(const T &)
+ uint16_t getErrorInfoFfdcSize(const T &)
{
return sizeof(T);
}
@@ -467,7 +493,7 @@ namespace ReturnCodeFfdc
* @brief Get FFDC Size specialization for ecmdDataBufferBase
*/
template<>
- inline int16_t getErrorInfoFfdcSize<ecmdDataBufferBase>(
+ inline uint16_t getErrorInfoFfdcSize<ecmdDataBufferBase>(
const ecmdDataBufferBase &)
{
return EI_FFDC_SIZE_ECMDDB;
@@ -477,7 +503,7 @@ namespace ReturnCodeFfdc
* @brief Get FFDC Size specialization for fapi::Target
*/
template<>
- inline int16_t getErrorInfoFfdcSize<fapi::Target>(
+ inline uint16_t getErrorInfoFfdcSize<fapi::Target>(
const fapi::Target &)
{
return EI_FFDC_SIZE_TARGET;
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C
index 1879fefd2..2d700ad7a 100644
--- a/src/usr/hwpf/fapi/fapiErrorInfo.C
+++ b/src/usr/hwpf/fapi/fapiErrorInfo.C
@@ -39,6 +39,7 @@
* structures into one
* mjjones 09/19/2012 Replace FFDC type with ID
* mjjones 03/22/2013 Support Procedure Callouts
+ * mjjones 05/20/2013 Support Bus Callouts
*/
#include <fapiErrorInfo.H>
@@ -89,12 +90,28 @@ ErrorInfoProcedureCallout::ErrorInfoProcedureCallout(
}
//******************************************************************************
+// ErrorInfoProcedureCallout Constructor
+//******************************************************************************
+ErrorInfoBusCallout::ErrorInfoBusCallout(
+ const Target & i_target1,
+ const Target & i_target2,
+ const CalloutPriorities::CalloutPriority i_calloutPriority)
+: iv_target1(i_target1), iv_target2(i_target2),
+ iv_calloutPriority(i_calloutPriority)
+{
+
+}
+
+//******************************************************************************
// ErrorInfoCDG Constructor
//******************************************************************************
-ErrorInfoCDG::ErrorInfoCDG(const Target & i_target)
-: iv_target(i_target), iv_callout(false),
- iv_calloutPriority(CalloutPriorities::LOW), iv_deconfigure(false),
- iv_gard(false)
+ErrorInfoCDG::ErrorInfoCDG(const Target & i_target,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority)
+: iv_target(i_target), iv_callout(i_callout), iv_calloutPriority(i_priority),
+ iv_deconfigure(i_deconfigure), iv_gard(i_gard)
{
}
@@ -127,30 +144,4 @@ ErrorInfo::~ErrorInfo()
}
}
-//******************************************************************************
-// ErrorInfo getCreateErrorInfoCDG
-//******************************************************************************
-ErrorInfoCDG & ErrorInfo::getCreateErrorInfoCDG(const Target & i_target)
-{
- ErrorInfoCDG * l_pInfo = NULL;
-
- for (ErrorInfo::ErrorInfoCDGCItr_t l_itr = iv_CDGs.begin();
- l_itr != iv_CDGs.end(); ++l_itr)
- {
- if ((*l_itr)->iv_target == i_target)
- {
- l_pInfo = (*l_itr);
- break;
- }
- }
-
- if (l_pInfo == NULL)
- {
- l_pInfo = new ErrorInfoCDG(i_target);
- iv_CDGs.push_back(l_pInfo);
- }
-
- return *l_pInfo;
-}
-
}
diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
index 4076ff5b0..8ca5884c6 100755
--- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
@@ -54,6 +54,7 @@
# mjjones 03/22/13 Support Procedure Callouts
# mjjones 04/25/13 Allow multiple register ffdc ids in a
# collectRegisterFfdc element
+# mjjones 05/20/13 Support Bus Callouts
#
# End Change Log ******************************************************
@@ -189,10 +190,10 @@ sub setErrorEnumValue
}
#------------------------------------------------------------------------------
-# Subroutine that figures out an FFDC enum value from an FFDC name and stores
-# it in global hashes
+# Subroutine that figures out an FFDC ID value from an FFDC name and stores it
+# in global hashes for use when creating the enumeration of FFDC IDs
#------------------------------------------------------------------------------
-sub setFfdcEnumValue
+sub setFfdcIdValue
{
my $name = $_[0];
@@ -445,72 +446,86 @@ foreach my $argnum (1 .. $#ARGV)
my @eiObjects;
my $eiObjectStr = "const void * l_objects[] = {";
- my $eiEntryStr = "fapi::ReturnCode::ErrorInfoEntry l_entries[] = {";
+ my $eiEntryStr = "";
my $eiEntryCount = 0;
+ my %cdgHash; # Records the callout/deconfigure/gards for each Target
# Local FFDC
foreach my $ffdc (@{$err->{ffdc}})
{
- # Set the FFDC enum value in a global hash. The name is <rc>_<ffdc>
+ # Set the FFDC ID value in a global hash. The name is <rc>_<ffdc>
my $ffdcName = $err->{rc} . "_";
$ffdcName = $ffdcName . $ffdc;
- setFfdcEnumValue($ffdcName);
+ setFfdcIdValue($ffdcName);
# Add the FFDC data to the EI Object array if it doesn't already exist
my $objNum = addEntryToArray(\@eiObjects, $ffdc);
- # Add an EI entry to eiEntryStr.
- if ($eiEntryCount > 0)
- {
- $eiEntryStr .= ", ";
- }
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_FFDC, $objNum, fapi::ReturnCodeFfdc::getErrorInfoFfdcSize($ffdc), fapi::$ffdcName}";
+ # Add an EI entry to eiEntryStr
+ $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_FFDC; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcObjIndex = $objNum; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcId = fapi::$ffdcName; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcSize = fapi::ReturnCodeFfdc::getErrorInfoFfdcSize($ffdc); \\\n";
$eiEntryCount++;
}
- # Procedure/Target callouts
+ # Procedure/Target/Bus callouts
foreach my $callout (@{$err->{callout}})
{
- if ((! exists $callout->{target}) && (! exists $callout->{procedure}))
- {
- print ("fapiParseErrorInfo.pl ERROR. Callout procedure/target missing\n");
- exit(1);
- }
-
if (! exists $callout->{priority})
{
print ("fapiParseErrorInfo.pl ERROR. Callout priority missing\n");
exit(1);
}
- my $objNum = 0;
- if (exists $callout->{target})
+ if (exists $callout->{procedure})
{
- # Check the type
- print EIFILE
- "fapi::fapiCheckType<const fapi::Target *>(&$callout->{target}); ";
-
- # Add the Target to the objectlist if it doesn't already exist
- $objNum = addEntryToArray(\@eiObjects, $callout->{target});
+ # Procedure Callout
+ # Add an EI entry to eiEntryStr
+ $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].proc_callout.iv_procedure = fapi::ProcedureCallouts::$callout->{procedure}; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].proc_callout.iv_calloutPriority = fapi::CalloutPriorities::$callout->{priority}; \\\n";
+ $eiEntryCount++;
}
-
- # Add an EI entry to eiEntryStr
- if ($eiEntryCount > 0)
+ elsif (exists $callout->{bus})
{
- $eiEntryStr .= ", ";
+ # A Bus Callout consists of two targets separated by
+ # commas/spaces
+ my @targets = split(/\s*,\s*|\s+/, $callout->{bus});
+
+ if (scalar @targets != 2)
+ {
+ print ("fapiParseErrorInfo.pl ERROR. did not find two targets in bus callout\n");
+ exit(1);
+ }
+
+ # Check the type of the Targets
+ print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$targets[0]); \\\n";
+ print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$targets[1]); \\\n";
+
+ # Add the Targets to the objectlist if they don't already exist
+ my $objNum1 = addEntryToArray(\@eiObjects, $targets[0]);
+ my $objNum2 = addEntryToArray(\@eiObjects, $targets[1]);
+
+ # Add an EI entry to eiEntryStr
+ $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_BUS_CALLOUT; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_endpoint1ObjIndex = $objNum1; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_endpoint2ObjIndex = $objNum2; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::$callout->{priority}; \\\n";
+ $eiEntryCount++;
}
-
- if (exists $callout->{target})
+ elsif (exists $callout->{target})
{
- $eiEntryStr .=
- "{fapi::ReturnCode::EI_TYPE_CALLOUT, $objNum, fapi::CalloutPriorities::$callout->{priority}, 0}";
+ # Add the Target to cdgHash to be processed with any
+ # deconfigure and GARD requests
+ $cdgHash{$callout->{target}}{callout} = 1;
+ $cdgHash{$callout->{target}}{priority} = $callout->{priority};
}
else
{
- $eiEntryStr .=
- "{fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT, 0, fapi::CalloutPriorities::$callout->{priority}, fapi::ProcedureCallouts::$callout->{procedure}}";
+ print ("fapiParseErrorInfo.pl ERROR. Callout procedure/target/bus missing\n");
+ exit(1);
}
- $eiEntryCount++;
}
# Target deconfigures
@@ -522,19 +537,9 @@ foreach my $argnum (1 .. $#ARGV)
exit(1);
}
- # Check the type
- print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$deconfigure->{target}); ";
-
- # Add the Target to the objectlist if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $deconfigure->{target});
-
- # Add an EI entry to eiEntryStr
- if ($eiEntryCount > 0)
- {
- $eiEntryStr .= ", ";
- }
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_DECONF, $objNum, 0, 0}";
- $eiEntryCount++;
+ # Add the Target to cdgHash to be processed with any
+ # callout and gard requests
+ $cdgHash{$deconfigure->{target}}{deconf} = 1;
}
# Target Gards
@@ -546,24 +551,52 @@ foreach my $argnum (1 .. $#ARGV)
exit(1);
}
+ # Add the Target to cdgHash (this target may also have
+ # callout and deconfigure requests
+ $cdgHash{$gard->{target}}{gard} = 1;
+ }
+
+ # Process the callout, deconfigures and GARDs for each Target
+ foreach my $cdg (keys %cdgHash)
+ {
# Check the type
- print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$gard->{target}); ";
+ print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$cdg); \\\n";
- # Add the Target to the objectlist if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $gard->{target});
+ my $callout = 0;
+ my $priority = 'LOW';
+ my $deconf = 0;
+ my $gard = 0;
- # Add an EI entry to eiEntryStr
- if ($eiEntryCount > 0)
+ if (exists $cdgHash{$cdg}->{callout})
+ {
+ $callout = 1;
+ }
+ if (exists $cdgHash{$cdg}->{priority})
{
- $eiEntryStr .= ", ";
+ $priority = $cdgHash{$cdg}->{priority};
}
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_GARD, $objNum, 0, 0}";
+ if (exists $cdgHash{$cdg}->{deconf})
+ {
+ $deconf = 1;
+ }
+ if (exists $cdgHash{$cdg}->{gard})
+ {
+ $gard = 1;
+ }
+
+ # Add the Target to the objectlist if it doesn't already exist
+ my $objNum = addEntryToArray(\@eiObjects, $cdg);
+
+ # Add an EI entry to eiEntryStr
+ $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_CDG; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_targetObjIndex = $objNum; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_callout = $callout; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_deconfigure = $deconf; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_gard = $gard; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::$priority; \\\n";
$eiEntryCount++;
}
- # Complete $eiEntryStr
- $eiEntryStr .= "};";
-
# Add all objects to $eiObjectStr
my $objCount = 0;
@@ -581,8 +614,10 @@ foreach my $argnum (1 .. $#ARGV)
# Print info to file
if ($eiEntryCount > 0)
{
- print EIFILE "{$eiObjectStr $eiEntryStr ";
- print EIFILE "RC.addErrorInfo(l_objects, l_entries, $eiEntryCount);}";
+ print EIFILE "\\\n{ \\\n $eiObjectStr \\\n";
+ print EIFILE " fapi::ReturnCode::ErrorInfoEntry l_entries[$eiEntryCount]; \\\n";
+ print EIFILE "$eiEntryStr";
+ print EIFILE " RC.addErrorInfo(l_objects, l_entries, $eiEntryCount); \\\n}";
}
print EIFILE "\n\n";
}
@@ -608,9 +643,9 @@ foreach my $argnum (1 .. $#ARGV)
}
#----------------------------------------------------------------------
- # Set the FFDC enum value in a global hash
+ # Set the FFDC ID value in a global hash
#----------------------------------------------------------------------
- setFfdcEnumValue($registerFfdc->{id}[0]);
+ setFfdcIdValue($registerFfdc->{id}[0]);
#----------------------------------------------------------------------
# Generate code to capture the registers in fapiCollectRegFfdc.C
diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C
index 0de6126cb..621b649e1 100644
--- a/src/usr/hwpf/fapi/fapiReturnCode.C
+++ b/src/usr/hwpf/fapi/fapiReturnCode.C
@@ -49,6 +49,7 @@
* mjjones 08/14/2012 Use new ErrorInfo structure
* mjjones 09/19/2012 Add FFDC ID to error info
* mjjones 03/22/2013 Support Procedure Callouts
+ * mjjones 05/20/2013 Support Bus Callouts
*/
#include <fapiReturnCode.H>
@@ -231,22 +232,19 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
{
for (uint32_t i = 0; i < i_count; i++)
{
- // Figure out the object that this ErrorInfo refers to
- const void * l_pObject = i_pObjects[i_pEntries[i].iv_object];
+ ErrorInfoType l_type = static_cast<ErrorInfoType>(
+ i_pEntries[i].iv_type);
- if (i_pEntries[i].iv_type == EI_TYPE_FFDC)
+ if (l_type == EI_TYPE_FFDC)
{
- // Get the size of the object to add as FFDC
- int8_t l_size = i_pEntries[i].iv_data1;
- uint32_t l_ffdcId = i_pEntries[i].iv_data2;
+ uint8_t l_objIndex = i_pEntries[i].ffdc.iv_ffdcObjIndex;
+ uint16_t l_size = i_pEntries[i].ffdc.iv_ffdcSize;
+ uint32_t l_ffdcId = i_pEntries[i].ffdc.iv_ffdcId;
- if (l_size > 0)
- {
- // This is a regular FFDC data object that can be directly
- // memcopied
- addEIFfdc(l_ffdcId, l_pObject, l_size);
- }
- else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_ECMDDB)
+ // Get the object to add as FFDC
+ const void * l_pObject = i_pObjects[l_objIndex];
+
+ if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_ECMDDB)
{
// The FFDC is a ecmdDataBufferBase
const ecmdDataBufferBase * l_pDb =
@@ -275,57 +273,65 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
}
else
{
- FAPI_ERR("addErrorInfo: Unrecognized FFDC data: %d", l_size);
+ // This is a regular FFDC data object that can be directly
+ // memcopied
+ addEIFfdc(l_ffdcId, l_pObject, l_size);
}
}
- else if (i_pEntries[i].iv_type == EI_TYPE_PROCEDURE_CALLOUT)
+ else if (l_type == EI_TYPE_PROCEDURE_CALLOUT)
{
ProcedureCallouts::ProcedureCallout l_proc =
- static_cast<ProcedureCallouts::ProcedureCallout>
- (i_pEntries[i].iv_data2);
+ static_cast<ProcedureCallouts::ProcedureCallout>(
+ i_pEntries[i].proc_callout.iv_procedure);
CalloutPriorities::CalloutPriority l_pri =
- static_cast<CalloutPriorities::CalloutPriority>
- (i_pEntries[i].iv_data1);
+ static_cast<CalloutPriorities::CalloutPriority>(
+ i_pEntries[i].proc_callout.iv_calloutPriority);
// Add the ErrorInfo
FAPI_ERR("addErrorInfo: Adding proc callout, proc: %d, pri: %d",
l_proc, l_pri);
addEIProcedureCallout(l_proc, l_pri);
}
- else if (i_pEntries[i].iv_type == EI_TYPE_CALLOUT)
+ else if (l_type == EI_TYPE_BUS_CALLOUT)
{
- // Get a pointer to the Target to callout and the priority
- const Target * l_pTarget = static_cast<const Target *>(l_pObject);
+ uint8_t l_ep1Index = i_pEntries[i].bus_callout.iv_endpoint1ObjIndex;
+ uint8_t l_ep2Index = i_pEntries[i].bus_callout.iv_endpoint2ObjIndex;
CalloutPriorities::CalloutPriority l_pri =
- static_cast<CalloutPriorities::CalloutPriority>
- (i_pEntries[i].iv_data1);
+ static_cast<CalloutPriorities::CalloutPriority>(
+ i_pEntries[i].bus_callout.iv_calloutPriority);
- // Add the ErrorInfo
- FAPI_ERR("addErrorInfo: Adding target callout, pri: %d", l_pri);
- addEICallout(*l_pTarget, l_pri);
- }
- else if (i_pEntries[i].iv_type == EI_TYPE_DECONF)
- {
- // Get a pointer to the Target to deconfigure
- const Target * l_pTarget = static_cast<const Target *>(l_pObject);
+ // Get the endpoint Targets for the bus to callout
+ const Target * l_pTarget1 = static_cast<const Target *>(
+ i_pObjects[l_ep1Index]);
+ const Target * l_pTarget2 = static_cast<const Target *>(
+ i_pObjects[l_ep2Index]);
// Add the ErrorInfo
- FAPI_ERR("addErrorInfo: Adding deconfigure");
- addEIDeconfigure(*l_pTarget);
+ FAPI_ERR("addErrorInfo: Adding bus callout, pri: %d", l_pri);
+ addEIBusCallout(*l_pTarget1, *l_pTarget2, l_pri);
}
- else if (i_pEntries[i].iv_type == EI_TYPE_GARD)
+ else if (l_type == EI_TYPE_CDG)
{
- // Get a pointer to the Target to create a GARD record for
- const Target * l_pTarget = static_cast<const Target *>(l_pObject);
+ uint8_t l_targIndex = i_pEntries[i].target_cdg.iv_targetObjIndex;
+ uint8_t l_callout = i_pEntries[i].target_cdg.iv_callout;
+ uint8_t l_deconf = i_pEntries[i].target_cdg.iv_deconfigure;
+ uint8_t l_gard = i_pEntries[i].target_cdg.iv_gard;
+ CalloutPriorities::CalloutPriority l_pri =
+ static_cast<CalloutPriorities::CalloutPriority>(
+ i_pEntries[i].target_cdg.iv_calloutPriority);
+
+ // Get the Target to cdg
+ const Target * l_pTarget = static_cast<const Target *>(
+ i_pObjects[l_targIndex]);
// Add the ErrorInfo
- FAPI_ERR("addErrorInfo: Adding GARD");
- addEIGard(*l_pTarget);
+ FAPI_ERR("addErrorInfo: Adding target cdg (%d%d%d), pri: %d",
+ l_callout, l_deconf, l_gard, l_pri);
+ addEICdg(*l_pTarget, l_callout, l_deconf, l_gard, l_pri);
}
else
{
- FAPI_ERR("addErrorInfo: Unrecognized EI type: %d",
- i_pEntries[i].iv_type);
+ FAPI_ERR("addErrorInfo: Unrecognized EI type: %d", l_type);
}
}
}
@@ -425,44 +431,35 @@ void ReturnCode::addEIProcedureCallout(
}
//******************************************************************************
-// addEICallout function
+// addEIBusCallout function
//******************************************************************************
-void ReturnCode::addEICallout(
- const Target & i_target,
+void ReturnCode::addEIBusCallout(
+ const Target & i_target1,
+ const Target & i_target2,
const CalloutPriorities::CalloutPriority i_priority)
{
- // Get/Create a ErrorInfoCDG object for the target and update the callout
- ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef().
- getCreateErrorInfo().getCreateErrorInfoCDG(i_target);
- l_errorInfoCdg.iv_callout = true;
-
- // If the same target is called out multiple times, use the highest priority
- if (i_priority > l_errorInfoCdg.iv_calloutPriority)
- {
- l_errorInfoCdg.iv_calloutPriority = i_priority;
- }
-}
-
-//******************************************************************************
-// addEIDeconfigure function
-//******************************************************************************
-void ReturnCode::addEIDeconfigure(const Target & i_target)
-{
- // Get/Create a ErrorInfoCDG object for the target and update the deconfig
- ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef().
- getCreateErrorInfo().getCreateErrorInfoCDG(i_target);
- l_errorInfoCdg.iv_deconfigure = true;
+ // Create an ErrorInfoBusCallout object and add it to the Error Information
+ ErrorInfoBusCallout * l_pCallout = new ErrorInfoBusCallout(
+ i_target1, i_target2, i_priority);
+ getCreateReturnCodeDataRef().getCreateErrorInfo().
+ iv_busCallouts.push_back(l_pCallout);
}
//******************************************************************************
-// addEIGard function
+// addEICdg function
//******************************************************************************
-void ReturnCode::addEIGard(const Target & i_target)
+void ReturnCode::addEICdg(
+ const Target & i_target,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority)
{
- // Get/Create a ErrorInfoCDG object for the target and update the GARD
- ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef().
- getCreateErrorInfo().getCreateErrorInfoCDG(i_target);
- l_errorInfoCdg.iv_gard = true;
+ // Create an ErrorInfoCDG object and add it to the Error Information
+ ErrorInfoCDG * l_pCdg = new ErrorInfoCDG(i_target, i_callout, i_deconfigure,
+ i_gard, i_priority);
+ getCreateReturnCodeDataRef().getCreateErrorInfo().
+ iv_CDGs.push_back(l_pCdg);
}
}
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
index 8b6f58776..a5c0ffa1d 100644
--- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
+++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
@@ -52,6 +52,13 @@
<procedure>LVL_SUPPORT</procedure>
<priority>MEDIUM</priority>
</callout>
+ <!-- Callout a bus - in reality, the two targets would be different -->
+ <!-- Commented out to avoid actually calling out a bus in UT
+ <callout>
+ <bus>UNIT_TEST_FFDC_MASTER_CHIP_TARGET,UNIT_TEST_FFDC_MASTER_CHIP_TARGET</bus>
+ <priority>MEDIUM</priority>
+ </callout>
+ -->
<!-- Callout MASTER_CHIP HIGH -->
<!-- Commented out to avoid actually calling out a chip in UT
<callout>
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index 6e8e2979a..f75e7a3c6 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -60,8 +60,7 @@ HWAS::callOutPriority xlateCalloutPriority(
}
else
{
- FAPI_ERR(
- "fapi::xlateCalloutPriority: Unknown priority 0x%x, assuming HIGH",
+ FAPI_ERR("fapi::xlateCalloutPriority: Unknown priority 0x%x, assuming HIGH",
i_fapiPri);
}
@@ -93,8 +92,7 @@ HWAS::epubProcedureID xlateProcedureCallout(
}
else
{
- FAPI_ERR(
- "fapi::xlateProcedureCallout: Unknown proc 0x%x, assuming CODE",
+ FAPI_ERR("fapi::xlateProcedureCallout: Unknown proc 0x%x, assuming CODE",
i_fapiProc);
}
@@ -157,6 +155,62 @@ void processEIProcCallouts(const ErrorInfo & i_errInfo,
}
}
+void processEIBusCallouts(const ErrorInfo & i_errInfo,
+ errlHndl_t io_pError)
+{
+ // Iterate through the bus callout requests, adding each to the error log
+ for (ErrorInfo::ErrorInfoBusCalloutCItr_t l_itr =
+ i_errInfo.iv_busCallouts.begin();
+ l_itr != i_errInfo.iv_busCallouts.end(); ++l_itr)
+ {
+ TARGETING::Target * l_pTarget1 =
+ reinterpret_cast<TARGETING::Target*>((*l_itr)->iv_target1.get());
+
+ TARGETING::Target * l_pTarget2 =
+ reinterpret_cast<TARGETING::Target*>((*l_itr)->iv_target1.get());
+
+// Issue 72257. Uncomment the following lines to add a bus callout to
+// the error log, the addBusCallout enums and interfaces are not in place yet
+// HWAS::callOutPriority l_priority =
+// xlateCalloutPriority((*l_itr)->iv_calloutPriority);
+
+ bool l_busTypeValid = true;
+// HWAS::busTypeEnum l_busType = HWAS::FSI_BUS_TYPE;
+ TARGETING::TYPE l_type1 = l_pTarget1->getAttr<TARGETING::ATTR_TYPE>();
+ TARGETING::TYPE l_type2 = l_pTarget2->getAttr<TARGETING::ATTR_TYPE>();
+
+ if ( ((l_type1 == TARGETING::TYPE_MCS) &&
+ (l_type2 == TARGETING::TYPE_MEMBUF)) ||
+ ((l_type1 == TARGETING::TYPE_MEMBUF) &&
+ (l_type2 == TARGETING::TYPE_MCS)) )
+ {
+// l_busType = HWAS::DMI_BUS_TYPE;
+ }
+ else if ((l_type1 == TARGETING::TYPE_ABUS) &&
+ (l_type2 == TARGETING::TYPE_ABUS))
+ {
+// l_busType = HWAS::A_BUS_TYPE;
+ }
+ else if ((l_type1 == TARGETING::TYPE_XBUS) &&
+ (l_type2 == TARGETING::TYPE_XBUS))
+ {
+// l_busType = HWAS::X_BUS_TYPE;
+ }
+ else
+ {
+ FAPI_ERR("processEIBusCallouts: Bus between target types not known (0x%08x:0x%08x)",
+ l_type1, l_type2);
+ l_busTypeValid = false;
+ }
+
+ if (l_busTypeValid)
+ {
+// io_pError->addBusCallout(l_pTarget1, l_pTarget2, l_busType,
+// l_priority);
+ }
+ }
+}
+
/**
* @brief Processes any Callout/Deconfigure/GARD requests in the ReturnCode Error
* Information and adds them to the error log
@@ -251,6 +305,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
// There is error information associated with the ReturnCode
processEIFfdcs(*l_pErrorInfo, l_pError);
processEIProcCallouts(*l_pErrorInfo, l_pError);
+ processEIBusCallouts(*l_pErrorInfo, l_pError);
processEICDGs(*l_pErrorInfo, l_pError);
}
else
@@ -283,6 +338,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
{
processEIFfdcs(*l_pErrorInfo, l_pError);
processEIProcCallouts(*l_pErrorInfo, l_pError);
+ processEIBusCallouts(*l_pErrorInfo, l_pError);
processEICDGs(*l_pErrorInfo, l_pError);
}
}
diff --git a/src/usr/hwpf/test/fapiRcTest.C b/src/usr/hwpf/test/fapiRcTest.C
index 4ace61dbc..4120cf4e6 100644
--- a/src/usr/hwpf/test/fapiRcTest.C
+++ b/src/usr/hwpf/test/fapiRcTest.C
@@ -606,25 +606,39 @@ uint32_t rcTest12()
ReturnCode l_rc;
l_rc.setFapiError(FAPI_RC_INVALID_ATTR_GET);
- // Create a DIMM target
+ // Create fake targets
uint32_t l_targetHandle = 3;
Target l_target(TARGET_TYPE_DIMM, &l_targetHandle);
+ uint32_t l_target2Handle = 4;
+ Target l_target2(TARGET_TYPE_PROC_CHIP, &l_target2Handle);
// Create some FFDC
uint8_t l_ffdc = 0x12;
- // Add error information to the ReturnCode
- const void * l_objects[] = {&l_ffdc, &l_target};
- fapi::ReturnCode::ErrorInfoEntry l_entries[] =
- {{fapi::ReturnCode::EI_TYPE_FFDC, 0,
- fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc)},
- {fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT, 0,
- fapi::CalloutPriorities::HIGH, fapi::ProcedureCallouts::CODE},
- {fapi::ReturnCode::EI_TYPE_CALLOUT, 1,
- fapi::CalloutPriorities::MEDIUM},
- {fapi::ReturnCode::EI_TYPE_DECONF, 1},
- {fapi::ReturnCode::EI_TYPE_GARD, 1}};
- l_rc.addErrorInfo(l_objects, l_entries, 5);
+ // Add error information to the ReturnCode, the data is the same as that
+ // produced by the fapiParseErrorInfo.pl script in fapiHwpErrorInfo.H
+ const void * l_objects[] = {&l_ffdc, &l_target, &l_target2};
+ fapi::ReturnCode::ErrorInfoEntry l_entries[4];
+ l_entries[0].iv_type = fapi::ReturnCode::EI_TYPE_FFDC;
+ l_entries[0].ffdc.iv_ffdcObjIndex = 0;
+ l_entries[0].ffdc.iv_ffdcId = 0x22334455;
+ l_entries[0].ffdc.iv_ffdcSize =
+ fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc);
+ l_entries[1].iv_type = fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT;
+ l_entries[1].proc_callout.iv_procedure = fapi::ProcedureCallouts::CODE;
+ l_entries[1].proc_callout.iv_calloutPriority = fapi::CalloutPriorities::MEDIUM;
+ l_entries[2].iv_type = fapi::ReturnCode::EI_TYPE_BUS_CALLOUT;
+ l_entries[2].bus_callout.iv_endpoint1ObjIndex = 1;
+ l_entries[2].bus_callout.iv_endpoint2ObjIndex = 2;
+ l_entries[2].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+ l_entries[3].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[3].target_cdg.iv_targetObjIndex = 1;
+ l_entries[3].target_cdg.iv_callout = 1;
+ l_entries[3].target_cdg.iv_deconfigure = 1;
+ l_entries[3].target_cdg.iv_gard = 0;
+ l_entries[3].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::HIGH;
+
+ l_rc.addErrorInfo(l_objects, l_entries, 4);
do
{
@@ -690,9 +704,9 @@ uint32_t rcTest12()
}
if (l_pErrInfo->iv_CDGs[0]->iv_calloutPriority !=
- CalloutPriorities::MEDIUM)
+ CalloutPriorities::HIGH)
{
- FAPI_ERR("rcTest12. callout priority mismatch (%d)",
+ FAPI_ERR("rcTest12. CDG callout priority mismatch (%d)",
l_pErrInfo->iv_CDGs[0]->iv_calloutPriority);
l_result = 8;
break;
@@ -705,9 +719,9 @@ uint32_t rcTest12()
break;
}
- if (l_pErrInfo->iv_CDGs[0]->iv_gard != true)
+ if (l_pErrInfo->iv_CDGs[0]->iv_gard != false)
{
- FAPI_ERR("rcTest12. GARD not set");
+ FAPI_ERR("rcTest12. GARD set");
l_result = 10;
break;
}
@@ -730,7 +744,7 @@ uint32_t rcTest12()
}
if (l_pErrInfo->iv_procedureCallouts[0]->iv_calloutPriority !=
- CalloutPriorities::HIGH)
+ CalloutPriorities::MEDIUM)
{
FAPI_ERR("rcTest12. procedure callout priority mismatch (%d)",
l_pErrInfo->iv_procedureCallouts[0]->iv_calloutPriority);
@@ -738,6 +752,38 @@ uint32_t rcTest12()
break;
}
+ if (l_pErrInfo->iv_busCallouts.size() != 1)
+ {
+ FAPI_ERR("rcTest12. %d bus-callouts",
+ l_pErrInfo->iv_busCallouts.size());
+ l_result = 14;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_target1 != l_target)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 1");
+ l_result = 15;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_target2 != l_target2)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 2");
+ l_result = 16;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_calloutPriority !=
+ CalloutPriorities::LOW)
+ {
+ FAPI_ERR("rcTest12. bus callout priority mismatch (%d)",
+ l_pErrInfo->iv_busCallouts[0]->iv_calloutPriority);
+ l_result = 17;
+ break;
+ }
+
+
FAPI_INF("rcTest12. Success!");
}
while(0);
@@ -762,8 +808,14 @@ uint32_t rcTest13()
// Add error information to the ReturnCode
const void * l_objects[] = {&l_target};
- fapi::ReturnCode::ErrorInfoEntry l_entries[] =
- {{fapi::ReturnCode::EI_TYPE_GARD, 0}};
+ fapi::ReturnCode::ErrorInfoEntry l_entries[1];
+ l_entries[0].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[0].target_cdg.iv_targetObjIndex = 0;
+ l_entries[0].target_cdg.iv_callout = 0;
+ l_entries[0].target_cdg.iv_deconfigure = 0;
+ l_entries[0].target_cdg.iv_gard = 1;
+ l_entries[0].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+
l_rc.addErrorInfo(l_objects, l_entries, 1);
// Create a ReturnCode using the copy constructor
@@ -846,8 +898,14 @@ uint32_t rcTest14()
// Add error information to the ReturnCode
const void * l_objects[] = {&l_target};
- fapi::ReturnCode::ErrorInfoEntry l_entries[] =
- {{fapi::ReturnCode::EI_TYPE_GARD, 0}};
+ fapi::ReturnCode::ErrorInfoEntry l_entries[1];
+ l_entries[0].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[0].target_cdg.iv_targetObjIndex = 0;
+ l_entries[0].target_cdg.iv_callout = 0;
+ l_entries[0].target_cdg.iv_deconfigure = 0;
+ l_entries[0].target_cdg.iv_gard = 1;
+ l_entries[0].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+
l_rc.addErrorInfo(l_objects, l_entries, 1);
// Create a ReturnCode using the assignment operator
@@ -931,8 +989,14 @@ uint32_t rcTest15()
// Add error information to the ReturnCode
const void * l_objects[] = {&l_target};
- fapi::ReturnCode::ErrorInfoEntry l_entries[] =
- {{fapi::ReturnCode::EI_TYPE_GARD, 0}};
+ fapi::ReturnCode::ErrorInfoEntry l_entries[1];
+ l_entries[0].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[0].target_cdg.iv_targetObjIndex = 0;
+ l_entries[0].target_cdg.iv_callout = 0;
+ l_entries[0].target_cdg.iv_deconfigure = 0;
+ l_entries[0].target_cdg.iv_gard = 1;
+ l_entries[0].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+
l_rc.addErrorInfo(l_objects, l_entries, 1);
// Set the ReturnCode to success
@@ -980,21 +1044,45 @@ uint32_t rcTest16()
// Add error information to the ReturnCode
const void * l_objects[] = {&l_ffdc, &l_ffdc2, &l_target, &l_target2};
- fapi::ReturnCode::ErrorInfoEntry l_entries[] =
- {{fapi::ReturnCode::EI_TYPE_FFDC, 0,
- fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc)},
- {fapi::ReturnCode::EI_TYPE_FFDC, 1,
- fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc2)},
- {fapi::ReturnCode::EI_TYPE_CALLOUT, 2, fapi::CalloutPriorities::HIGH},
- {fapi::ReturnCode::EI_TYPE_CALLOUT, 3, fapi::CalloutPriorities::LOW},
- {fapi::ReturnCode::EI_TYPE_DECONF, 2},
- {fapi::ReturnCode::EI_TYPE_DECONF, 3},
- {fapi::ReturnCode::EI_TYPE_GARD, 2},
- {fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT, 0,
- fapi::CalloutPriorities::HIGH, fapi::ProcedureCallouts::CODE},
- {fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT, 0,
- fapi::CalloutPriorities::MEDIUM, fapi::ProcedureCallouts::LVL_SUPPORT}};
- l_rc.addErrorInfo(l_objects, l_entries, 9);
+ fapi::ReturnCode::ErrorInfoEntry l_entries[8];
+ l_entries[0].iv_type = fapi::ReturnCode::EI_TYPE_FFDC;
+ l_entries[0].ffdc.iv_ffdcObjIndex = 0;
+ l_entries[0].ffdc.iv_ffdcId = 0x22334455;
+ l_entries[0].ffdc.iv_ffdcSize =
+ fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc);
+ l_entries[1].iv_type = fapi::ReturnCode::EI_TYPE_FFDC;
+ l_entries[1].ffdc.iv_ffdcObjIndex = 1;
+ l_entries[1].ffdc.iv_ffdcId = 0x33445566;
+ l_entries[1].ffdc.iv_ffdcSize =
+ fapi::ReturnCodeFfdc::getErrorInfoFfdcSize(l_ffdc2);
+ l_entries[2].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[2].target_cdg.iv_targetObjIndex = 2;
+ l_entries[2].target_cdg.iv_callout = 0;
+ l_entries[2].target_cdg.iv_deconfigure = 1;
+ l_entries[2].target_cdg.iv_gard = 0;
+ l_entries[2].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::HIGH;
+ l_entries[3].iv_type = fapi::ReturnCode::EI_TYPE_CDG;
+ l_entries[3].target_cdg.iv_targetObjIndex = 3;
+ l_entries[3].target_cdg.iv_callout = 0;
+ l_entries[3].target_cdg.iv_deconfigure = 0;
+ l_entries[3].target_cdg.iv_gard = 1;
+ l_entries[3].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::MEDIUM;
+ l_entries[4].iv_type = fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT;
+ l_entries[4].proc_callout.iv_procedure = fapi::ProcedureCallouts::CODE;
+ l_entries[4].proc_callout.iv_calloutPriority = fapi::CalloutPriorities::MEDIUM;
+ l_entries[5].iv_type = fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT;
+ l_entries[5].proc_callout.iv_procedure = fapi::ProcedureCallouts::LVL_SUPPORT;
+ l_entries[5].proc_callout.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+ l_entries[6].iv_type = fapi::ReturnCode::EI_TYPE_BUS_CALLOUT;
+ l_entries[6].bus_callout.iv_endpoint1ObjIndex = 2;
+ l_entries[6].bus_callout.iv_endpoint2ObjIndex = 3;
+ l_entries[6].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::LOW;
+ l_entries[7].iv_type = fapi::ReturnCode::EI_TYPE_BUS_CALLOUT;
+ l_entries[7].bus_callout.iv_endpoint1ObjIndex = 2;
+ l_entries[7].bus_callout.iv_endpoint2ObjIndex = 3;
+ l_entries[7].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::HIGH;
+
+ l_rc.addErrorInfo(l_objects, l_entries, 8);
do
{
@@ -1069,54 +1157,68 @@ uint32_t rcTest16()
break;
}
+ if (l_pErrInfo->iv_CDGs[0]->iv_callout != false)
+ {
+ FAPI_ERR("rcTest16. CDG[0] callout set");
+ l_result = 9;
+ break;
+ }
+
if (l_pErrInfo->iv_CDGs[0]->iv_calloutPriority !=
CalloutPriorities::HIGH)
{
FAPI_ERR("rcTest16. CDG[0] callout priority mismatch");
- l_result = 9;
+ l_result = 10;
break;
}
- if (l_pErrInfo->iv_CDGs[0]->iv_deconfigure == false)
+ if (l_pErrInfo->iv_CDGs[0]->iv_deconfigure != true)
{
FAPI_ERR("rcTest16. CDG[0] deconfigure not set");
- l_result = 10;
+ l_result = 11;
break;
}
- if (l_pErrInfo->iv_CDGs[0]->iv_gard == false)
+ if (l_pErrInfo->iv_CDGs[0]->iv_gard != false)
{
- FAPI_ERR("rcTest16. CDG[0] gard not set");
- l_result = 11;
+ FAPI_ERR("rcTest16. CDG[0] gard set");
+ l_result = 12;
break;
}
if (l_pErrInfo->iv_CDGs[1]->iv_target != l_target2)
{
FAPI_ERR("rcTest16. CDG[1] target mismatch");
- l_result = 12;
+ l_result = 13;
+ break;
+ }
+
+ if (l_pErrInfo->iv_CDGs[1]->iv_callout != false)
+ {
+ FAPI_ERR("rcTest16. CDG[0] callout set");
+ l_result = 14;
break;
}
if (l_pErrInfo->iv_CDGs[1]->iv_calloutPriority !=
- CalloutPriorities::LOW)
+ CalloutPriorities::MEDIUM)
{
FAPI_ERR("rcTest16. CDG[1] callout priority mismatch");
- l_result = 13;
+ l_result = 15;
break;
}
- if (l_pErrInfo->iv_CDGs[1]->iv_deconfigure == false)
+ if (l_pErrInfo->iv_CDGs[1]->iv_deconfigure != false)
{
- FAPI_ERR("rcTest16. CDG[1] deconfigure not set");
- l_result = 14;
+ FAPI_ERR("rcTest16. CDG[1] deconfigure set");
+ l_result = 16;
break;
}
- if (l_pErrInfo->iv_CDGs[1]->iv_gard == true)
+ if (l_pErrInfo->iv_CDGs[1]->iv_gard != true)
{
- FAPI_ERR("rcTest16. CDG[1] gard set");
- l_result = 15;
+ FAPI_ERR("rcTest16. CDG[1] gard not set");
+ l_result = 17;
break;
}
@@ -1124,7 +1226,7 @@ uint32_t rcTest16()
{
FAPI_ERR("rcTest16. %d proc-callouts",
l_pErrInfo->iv_procedureCallouts.size());
- l_result = 16;
+ l_result = 18;
break;
}
@@ -1133,16 +1235,16 @@ uint32_t rcTest16()
{
FAPI_ERR("rcTest16. procedure[0] callout mismatch (%d)",
l_pErrInfo->iv_procedureCallouts[0]->iv_procedure);
- l_result = 17;
+ l_result = 19;
break;
}
if (l_pErrInfo->iv_procedureCallouts[0]->iv_calloutPriority !=
- CalloutPriorities::HIGH)
+ CalloutPriorities::MEDIUM)
{
FAPI_ERR("rcTest16. procedure[0] callout priority mismatch (%d)",
l_pErrInfo->iv_procedureCallouts[0]->iv_calloutPriority);
- l_result = 18;
+ l_result = 20;
break;
}
@@ -1151,16 +1253,70 @@ uint32_t rcTest16()
{
FAPI_ERR("rcTest16. procedure[1] callout mismatch (%d)",
l_pErrInfo->iv_procedureCallouts[1]->iv_procedure);
- l_result = 19;
+ l_result = 21;
break;
}
if (l_pErrInfo->iv_procedureCallouts[1]->iv_calloutPriority !=
- CalloutPriorities::MEDIUM)
+ CalloutPriorities::LOW)
{
FAPI_ERR("rcTest16. procedure[1] callout priority mismatch (%d)",
l_pErrInfo->iv_procedureCallouts[1]->iv_calloutPriority);
- l_result = 20;
+ l_result = 22;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts.size() != 2)
+ {
+ FAPI_ERR("rcTest16. %d bus-callouts",
+ l_pErrInfo->iv_busCallouts.size());
+ l_result = 23;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_target1 != l_target)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 1");
+ l_result = 24;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_target2 != l_target2)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 2");
+ l_result = 25;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[0]->iv_calloutPriority !=
+ CalloutPriorities::LOW)
+ {
+ FAPI_ERR("rcTest12. bus callout priority mismatch 1 (%d)",
+ l_pErrInfo->iv_busCallouts[0]->iv_calloutPriority);
+ l_result = 26;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[1]->iv_target1 != l_target)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 3");
+ l_result = 27;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[1]->iv_target2 != l_target2)
+ {
+ FAPI_ERR("rcTest12. bus target mismatch 4");
+ l_result = 28;
+ break;
+ }
+
+ if (l_pErrInfo->iv_busCallouts[1]->iv_calloutPriority !=
+ CalloutPriorities::HIGH)
+ {
+ FAPI_ERR("rcTest12. bus callout priority mismatch 2 (%d)",
+ l_pErrInfo->iv_busCallouts[1]->iv_calloutPriority);
+ l_result = 29;
break;
}
OpenPOWER on IntegriCloud