summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2015-04-01 12:34:46 -0500
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 13:40:20 -0600
commitb7f264ad18b352246d58892929a1c38b2fce015c (patch)
tree39951a727f0575fb9a613ced64ad6cd8f8aef712 /src/import
parent92ee729f17fc3a98f56d60707cb8a02f7853cf0b (diff)
downloadtalos-hostboot-b7f264ad18b352246d58892929a1c38b2fce015c.tar.gz
talos-hostboot-b7f264ad18b352246d58892929a1c38b2fce015c.zip
FFDC collection for buffers, exectue() takes a sev parameter
Change-Id: Iffb9539211b57cf371432ae6a4468577b5a91aad Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16818 Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Brian Silver <bsilver@us.ibm.com> Tested-by: Brian Silver <bsilver@us.ibm.com>
Diffstat (limited to 'src/import')
-rwxr-xr-xsrc/import/hwpf/fapi2/docs/topics/Ffdc.md21
-rw-r--r--src/import/hwpf/fapi2/include/error_info.H3
-rw-r--r--src/import/hwpf/fapi2/include/return_code.H11
-rw-r--r--src/import/hwpf/fapi2/src/error_info.C16
-rwxr-xr-xsrc/import/hwpf/fapi2/tools/parseErrorInfo.pl8
5 files changed, 29 insertions, 30 deletions
diff --git a/src/import/hwpf/fapi2/docs/topics/Ffdc.md b/src/import/hwpf/fapi2/docs/topics/Ffdc.md
index 85d696b1a..b55f60e0f 100755
--- a/src/import/hwpf/fapi2/docs/topics/Ffdc.md
+++ b/src/import/hwpf/fapi2/docs/topics/Ffdc.md
@@ -124,6 +124,27 @@ And it can be used:
Note the indifference to integral or variable buffers.
+### Collecting Buffers as Part of FFDC
+
+To collect a buffer as part of an FFDC collection (as opposed to being
+the FFDC you want to collect) you can add it to the XML:
+
+ <buffer>RAS_STATUS</buffer>
+
+This will generate fapi2::buffer and fapi2::variable_buffer set methods
+for this element:
+
+ fapi2::buffer<uint64_t> data;
+ set_RAS_STATUS(data) ...
+
+Also, you can force the conversion of the buffer to an integral
+type without changing the XML
+
+ <ffdc>RAS_STATUS</ffdc>
+
+ fapi2::buffer<uint64_t> data;
+ set_RAS_STATUS(unt64_t(data)) ...
+
## Error Log Generation
FAPI had a function called fapiLogError() which would generate platform
diff --git a/src/import/hwpf/fapi2/include/error_info.H b/src/import/hwpf/fapi2/include/error_info.H
index 30f829987..3f53503de 100644
--- a/src/import/hwpf/fapi2/include/error_info.H
+++ b/src/import/hwpf/fapi2/include/error_info.H
@@ -71,9 +71,7 @@ namespace fapi2
/// special type that cannot simply be memcopied
enum ErrorInfoFfdcSize
{
- EI_FFDC_SIZE_BUF = 0xffff, // fapi2::buffer<T>
EI_FFDC_SIZE_TARGET = 0xfffe, // fapi2::Target
- EI_FFDC_SIZE_VBUF = 0xfffd, // fapi2::variable_buffer
EI_FFDC_MAX_SIZE = 0x1000, // Limit regular FFDC capture to 4kb
};
@@ -82,6 +80,7 @@ namespace fapi2
///
enum errlSeverity_t
{
+ FAPI2_ERRL_SEV_UNDEFINED = 0x00, /// Used internally by ffdc mechanism
FAPI2_ERRL_SEV_RECOVERED = 0x10, /// Not seen by customer
FAPI2_ERRL_SEV_PREDICTIVE = 0x20, /// Error recovered but customer will see
FAPI2_ERRL_SEV_UNRECOVERABLE = 0x40 /// Unrecoverable, general
diff --git a/src/import/hwpf/fapi2/include/return_code.H b/src/import/hwpf/fapi2/include/return_code.H
index 1e48854db..e4f8edac5 100644
--- a/src/import/hwpf/fapi2/include/return_code.H
+++ b/src/import/hwpf/fapi2/include/return_code.H
@@ -144,17 +144,10 @@ namespace fapi2
///
/// @brief Assignement operator
///
+#ifdef DOXYGEN
inline ReturnCode& operator=(const uint64_t& rhs)
- {
- iv_rc = rhs;
- return *this;
- }
-
inline ReturnCode& operator=(const ReturnCodes& rhs)
- {
- iv_rc = rhs;
- return *this;
- }
+#endif
inline bool operator==(const uint64_t& rhs) const
{ return rhs == iv_rc; }
diff --git a/src/import/hwpf/fapi2/src/error_info.C b/src/import/hwpf/fapi2/src/error_info.C
index 9d44eb58b..7dfd2e8d2 100644
--- a/src/import/hwpf/fapi2/src/error_info.C
+++ b/src/import/hwpf/fapi2/src/error_info.C
@@ -178,24 +178,8 @@ namespace fapi2
void ErrorInfoEntryFfdc::addErrorInfo(std::shared_ptr<ErrorInfo> i_info,
const void* const* i_objects) const
{
- // "variable buffer ffdc not yet implemented");
- assert(iv_ffdcSize != EI_FFDC_SIZE_VBUF);
-
switch(iv_ffdcSize)
{
- case EI_FFDC_SIZE_BUF:
- {
- const buffer<uint64_t>* object =
- static_cast<const buffer<uint64_t>*>(i_objects[iv_ffdcObjIndex]);
-
- i_info->iv_ffdcs.push_back(std::shared_ptr<ErrorInfoFfdc>(
- new ErrorInfoFfdc(iv_ffdcId, object,
- sizeof(object))));
-
- FAPI_DBG("addErrorInfo: Adding buffer id: 0x%x size: %lu buf: 0x%lx",
- iv_ffdcId, sizeof(object), uint64_t(*object));
- }
- break;
case EI_FFDC_SIZE_TARGET:
{
diff --git a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
index f4a0107b4..e394a17ea 100755
--- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
+++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
@@ -1184,11 +1184,13 @@ foreach my $argnum (0 .. $#ARGV)
print ECFILE $methods{$key}{method};
}
- # Stick the execute method at the end of the other methods.
- print ECFILE " void execute(void)\n";
+ # Stick the execute method at the end of the other methods. We allow
+ # passing in of the severity so that macros which call execute() can over-ride
+ # the default severity.
+ print ECFILE " void execute(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNDEFINED)\n";
print ECFILE " {\n";
print ECFILE " FAPI_SET_HWP_ERROR(iv_rc, $err->{rc});\n" if ($arg_empty_ffdc eq undef);
- print ECFILE " fapi2::logError(iv_rc, iv_sev);\n" if ($arg_empty_ffdc eq undef);
+ print ECFILE " fapi2::logError(iv_rc, (i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED) ? iv_sev : i_sev);\n" if ($arg_empty_ffdc eq undef);
print ECFILE " }\n\n";
# Instance variables
OpenPOWER on IntegriCloud