summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2011-11-01 16:53:35 -0500
committerMIKE J. JONES <mjjones@us.ibm.com>2011-11-02 14:36:37 -0500
commit022876203657ff7d370ea00e520b97432d1e8af5 (patch)
treec8b3058cc9df9873e69256620a6e179684f79cdc /src
parented263715d32cbc99d0945a94878cc5cd6af513ac (diff)
downloadtalos-hostboot-022876203657ff7d370ea00e520b97432d1e8af5.tar.gz
talos-hostboot-022876203657ff7d370ea00e520b97432d1e8af5.zip
HWPF: Improve HWPF Error Logs
Change-Id: Id35ad1cec7904c63f3d4f073c0014de58240c31c Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/474 Tested-by: Jenkins Server Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com> Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCodes.H9
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatReasonCodes.H48
-rwxr-xr-xsrc/usr/errl/parser/scanforsrcs.pl4
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseAttributeInfo.pl1
-rw-r--r--src/usr/hwpf/hwp/fapiHwpErrorInfo.xml8
-rwxr-xr-xsrc/usr/hwpf/hwp/fapiTestHwpAttr.C31
-rw-r--r--src/usr/hwpf/makefile9
-rwxr-xr-xsrc/usr/hwpf/plat/fapiCreateHwpErrorTags.pl161
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C57
9 files changed, 265 insertions, 63 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodes.H b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
index 438f768c8..5a07d8f87 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCodes.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
@@ -36,6 +36,7 @@
* mjjones 08/10/2011 Add FAPI_RC_FFDC_HWP_NOT_FOUND
* mjjones 09/23/2011 Remove FAPI_RC_FFDC_HWP_NOT_FOUND
* mjjones 10/07/2011 Add FAPI_RC_INVALID_ATTR_GET
+ * mjjones 10/28/2011 Trim FAPI/PLAT errors
*/
#ifndef FAPIRETURNCODES_H_
@@ -60,14 +61,10 @@ enum
FAPI_RC_ECMD_MASK = ECMD_ERR_ECMD, // ECMD generated error (0x01000000)
// FAPI generated return codes
- FAPI_RC_NOT_IMPLEMENTED = FAPI_RC_FAPI_MASK | 0x01,
- FAPI_RC_ATTR_UNIT_TEST_FAIL = FAPI_RC_FAPI_MASK | 0x02,
- FAPI_RC_INVALID_ATTR_GET = FAPI_RC_FAPI_MASK | 0x03,
+ FAPI_RC_INVALID_ATTR_GET = FAPI_RC_FAPI_MASK | 0x01,
// PLAT generated return codes
- FAPI_RC_PLAT_ERR_SEE_DATA = FAPI_RC_PLAT_MASK | 0x01,
- // Error details in attached ReturnCodeData
- FAPI_RC_PLAT_NOT_IMPLEMENTED = FAPI_RC_PLAT_MASK | 0x02,
+ FAPI_RC_PLAT_ERR_SEE_DATA = FAPI_RC_PLAT_MASK | 0x01,
};
}
diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
index d5fe9faf1..7f7025cb9 100644
--- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
+++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
@@ -29,25 +29,45 @@ namespace fapi
{
enum hwpfModuleId
{
- MOD_RC_TO_ERRL = 0x01,
- MOD_FAPI_GET_CHILD_CHIPLETS = 0x02,
- MOD_FAPI_GET_PARENT_CHIP = 0x03,
- MOD_PLAT_ATTR_SVC_CREATE_ATTR_ACCESS_ERROR = 0x04,
- MOD_HANDLE_ECMD_BUF_RC = 0x05,
- MOD_VERIFY_CFAM_ACCESS_TARGET = 0x06,
+ // HWP generated errors
+ MOD_HWP_RC_TO_ERRL = 0x01,
+
+ // FAPI generated errors
+ MOD_FAPI_RC_TO_ERRL = 0x02,
+
+ // PLAT generated errros
+ MOD_FAPI_GET_CHILD_CHIPLETS = 0x03,
+ MOD_FAPI_GET_PARENT_CHIP = 0x04,
+ MOD_PLAT_ATTR_SVC_CREATE_ATTR_ACCESS_ERROR = 0x05,
+ MOD_HANDLE_ECMD_BUF_RC = 0x06,
+ MOD_VERIFY_CFAM_ACCESS_TARGET = 0x07,
};
+ // Note that for HWP generated errors (MOD_HWP_RC_TO_ERRL), the
+ // reason code is in the generated fapiHwpReasonCodes.H file
+
enum hwpfReasonCode
{
- RC_HWP_ERROR = HWPF_COMP_ID | 0x01,
- RC_FAPI_ERROR = HWPF_COMP_ID | 0x02,
- RC_INVALID_REQUEST = HWPF_COMP_ID | 0x03,
- RC_UNSUPPORTED_REQUEST = HWPF_COMP_ID | 0x04,
- RC_NO_SINGLE_PARENT = HWPF_COMP_ID | 0x05,
- RC_FAILED_TO_ACCESS_ATTRIBUTE = HWPF_COMP_ID | 0x06,
- RC_ECMD_OPERATION_FAILURE = HWPF_COMP_ID | 0x07,
- RC_CFAM_ACCESS_ON_PROC_ERR = HWPF_COMP_ID | 0x08,
+ // FAPI generated errors (see fapiReturnCodes.H)
+ RC_INVALID_ATTR_GET = HWPF_COMP_ID | 0x01,
+
+ // PLAT Errors generated by HostBoot code
+ RC_INVALID_REQUEST = HWPF_COMP_ID | 0x10,
+ RC_UNSUPPORTED_REQUEST = HWPF_COMP_ID | 0x11,
+ RC_NO_SINGLE_PARENT = HWPF_COMP_ID | 0x12,
+ RC_FAILED_TO_ACCESS_ATTRIBUTE = HWPF_COMP_ID | 0x13,
+ RC_ECMD_OPERATION_FAILURE = HWPF_COMP_ID | 0x14,
+ RC_CFAM_ACCESS_ON_PROC_ERR = HWPF_COMP_ID | 0x15,
};
};
+// HostBoot ErrorLog tags for FAPI errors
+/*@
+ * @errortype
+ * @moduleid MOD_FAPI_RC_TO_ERRL
+ * @reasoncode RC_INVALID_ATTR_GET
+ * @devdesc InitFile HW Procedure requested an invalid attribute
+ */
+
+
#endif
diff --git a/src/usr/errl/parser/scanforsrcs.pl b/src/usr/errl/parser/scanforsrcs.pl
index 83fbfed5a..c54df9fb1 100755
--- a/src/usr/errl/parser/scanforsrcs.pl
+++ b/src/usr/errl/parser/scanforsrcs.pl
@@ -548,6 +548,10 @@ EOF
my $startDir = $sandBase."/src/include/usr/*";
includeReasonCodes( $fh, $startDir, 1 );
+ # Also include reason codes from generated files
+ $startDir = $sandBase."/obj/genfiles";
+ includeReasonCodes( $fh, $startDir, 0 );
+
print $fh <<EOF;
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
index 34d08ef54..2d7051b5e 100755
--- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
@@ -341,6 +341,7 @@ print AIFILE "#endif\n";
print ASFILE " else\n";
print ASFILE " {\n";
print ASFILE " FAPI_ERR(\"fapiGetInitFileAttr: Unrecognized attr: %d\", i_id);\n";
+print ASFILE " ReturnCodeFfdc::addEIFfdc(l_rc, static_cast<uint32_t>(i_id));";
print ASFILE " l_rc = FAPI_RC_INVALID_ATTR_GET;\n";
print ASFILE " }\n\n";
print ASFILE " if (l_rc)\n";
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
index df40e1010..817d06c34 100644
--- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
+++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
@@ -27,7 +27,7 @@
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_TEST_ERROR_A</rc>
- <description>Test Error A</description>
+ <description>HWP Unit Test expected error A</description>
<!-- Call hwpTestFfdc1 to collect FFDC from the master chip -->
<collectFfdc>hwpTestFfdc1, MASTER_CHIP</collectFfdc>
<!-- Collect local FFDC FFDC_DATA_1 -->
@@ -49,7 +49,7 @@
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_TEST_ERROR_B</rc>
- <description>Test Error B</description>
+ <description>HWP Unit Test expected error B</description>
<!-- Call hwpTestAnalyzeError on MASTER_CHIP to analyze the error -->
<callFunc>hwpTestAnalyzeError, MASTER_CHIP</callFunc>
</hwpError>
@@ -77,4 +77,8 @@
<rc>RC_HWP_EXEC_INITFILE_TEST_FAILED</rc>
<description>HWP Exec InitFile test case failed </description>
</hwpError>
+ <hwpError>
+ <rc>RC_HWP_ATTR_UNIT_TEST_FAIL</rc>
+ <description>HWP Attribute Unit Test failed</description>
+ </hwpError>
</hwpErrors>
diff --git a/src/usr/hwpf/hwp/fapiTestHwpAttr.C b/src/usr/hwpf/hwp/fapiTestHwpAttr.C
index 03a0f9f1e..1fae73b75 100755
--- a/src/usr/hwpf/hwp/fapiTestHwpAttr.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpAttr.C
@@ -38,6 +38,7 @@
* mjjones 10/15/2011 Test scratch attributes
* mjjones 10/17/2011 Update scratch test
* camvanng 10/26/2011 Update scratch test
+ * mjjones 10/28/2011 Fix error generation
*/
#include <fapiTestHwpAttr.H>
@@ -83,7 +84,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint8 != 7)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT8_1. GET returned %d",
l_uint8);
break;
@@ -125,7 +126,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint8 != 6)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT8_2. GET returned %d",
l_uint8);
break;
@@ -167,7 +168,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint32 != 5)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT32_1. GET returned %d",
l_uint32);
break;
@@ -209,7 +210,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint32 != 4)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT32_2. GET returned %d",
l_uint32);
break;
@@ -251,7 +252,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint64 != 3)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_1. GET returned %d",
static_cast<uint32_t>(l_uint64));
break;
@@ -293,7 +294,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint64 != 2)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. GET returned %d",
static_cast<uint32_t>(l_uint64));
break;
@@ -346,7 +347,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint8array1[i] != (i + 1))
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT8_ARRAY_1. GET [%d] returned %d",
i, l_uint8array1[i]);
break;
@@ -428,7 +429,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint8array2[i][j][k] != l_uint8++)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT8_ARRAY_2. GET [%d:%d:%d] returned %d",
i, j, k, l_uint8array2[i][j][k]);
break;
@@ -507,7 +508,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint32array1[i] != (i + 1))
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT32_ARRAY_1. GET [%d] returned %d",
i, l_uint32array1[i]);
break;
@@ -581,7 +582,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint32array2[i][j] != l_uint32++)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT32_ARRAY_2. GET [%d:%d] returned %d",
i, j, l_uint32array2[i][j]);
break;
@@ -652,7 +653,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint64array1[i] != (i + 1))
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_ARRAY_1. GET [%d] returned %d",
i, static_cast<uint32_t>(l_uint64array1[i]));
break;
@@ -726,7 +727,7 @@ fapi::ReturnCode hwpTestAttributes()
{
if (l_uint64array2[i][j] != l_uint64++)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_ARRAY_2. GET [%d:%d] returned %d",
i, j, static_cast<uint32_t>(l_uint64array2[i][j]));
break;
@@ -786,7 +787,7 @@ fapi::ReturnCode hwpTestAttributes()
// Check value
if (l_uint64 != fapi::ATTR_SCRATCH_UINT64_2_VAL_C)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_2. GET returned %d (enum)",
static_cast<uint32_t>(l_uint64));
break;
@@ -835,7 +836,7 @@ fapi::ReturnCode hwpTestAttributes()
if (l_val != 0)
{
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: ID: %d. Get returned %d",
l_ids[i], static_cast<uint32_t>(l_val));
break;
@@ -863,8 +864,8 @@ fapi::ReturnCode hwpTestAttributes()
}
else
{
+ FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL);
FAPI_ERR("hwpTestAttributes: Did not get error from fapiGetInitFileAttr");
- l_rc = fapi::FAPI_RC_ATTR_UNIT_TEST_FAIL;
break;
}
diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile
index 1842daae7..7749368ec 100644
--- a/src/usr/hwpf/makefile
+++ b/src/usr/hwpf/makefile
@@ -25,7 +25,9 @@ MODULE = hwpf
FAPI_ERROR_TARGETS = fapiHwpReturnCodes.H fapiHwpErrorInfo.H
FAPI_ATTR_TARGETS = fapiAttributeIds.H fapiAttributeService.C
-GENFILES = ${FAPI_ERROR_TARGETS} ${FAPI_ATTR_TARGETS}
+FAPI_HWP_ERROR_TAGS = fapiHwpReasonCodes.H
+
+GENFILES = ${FAPI_ERROR_TARGETS} ${FAPI_ATTR_TARGETS} ${FAPI_HWP_ERROR_TAGS}
SUBDIRS = fapi.d hwp.d plat.d test.d
@@ -40,3 +42,8 @@ $(call GENTARGET, $(FAPI_ERROR_TARGETS)) : \
$(call GENTARGET, $(FAPI_ATTR_TARGETS)) : \
fapi/fapiParseAttributeInfo.pl hwp/fapiHwpAttributeInfo.xml
$< $(dir $@) $(filter-out $<,$^)
+
+$(call GENTARGET, $(FAPI_HWP_ERROR_TAGS)) : \
+ plat/fapiCreateHwpErrorTags.pl hwp/fapiHwpErrorInfo.xml
+ $< $(dir $@) $(filter-out $<,$^)
+
diff --git a/src/usr/hwpf/plat/fapiCreateHwpErrorTags.pl b/src/usr/hwpf/plat/fapiCreateHwpErrorTags.pl
new file mode 100755
index 000000000..572d7360e
--- /dev/null
+++ b/src/usr/hwpf/plat/fapiCreateHwpErrorTags.pl
@@ -0,0 +1,161 @@
+#!/usr/bin/perl
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/plat/fapiCreateHwpErrorTags.pl $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2011
+#
+# 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 other-
+# wise divested of its trade secrets, irrespective of what has
+# been deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END
+
+#
+# Purpose: This perl script will parse HWP Error XML files and create required
+# HostBoot ReasonCodes and Error Log Tags. It creates file
+# fapiHwpReasonCodes.H:
+#
+# Author: Mike Jones
+#
+
+use strict;
+
+#------------------------------------------------------------------------------
+# Print Command Line Help
+#------------------------------------------------------------------------------
+my $numArgs = $#ARGV + 1;
+if ($numArgs < 2)
+{
+ print ("Usage: fapiCreateHwpErrorTags.pl <output dir> <filename1> <filename2> ...\n");
+ print (" This perl script will parse HWP Error XML files and create\n");
+ print (" required HostBoot ReasonCodes and Error Log tags\n");
+ exit(1);
+}
+
+#------------------------------------------------------------------------------
+# Specify perl modules to use
+#------------------------------------------------------------------------------
+use XML::Simple;
+my $xml = new XML::Simple (KeyAttr=>[]);
+
+# Uncomment to enable debug output
+#use Data::Dumper;
+
+#------------------------------------------------------------------------------
+# Open output files for writing
+#------------------------------------------------------------------------------
+my $rcFile = $ARGV[0];
+$rcFile .= "/";
+$rcFile .= "fapiHwpReasonCodes.H";
+open(TGFILE, ">", $rcFile);
+
+#------------------------------------------------------------------------------
+# Print start of file information
+#------------------------------------------------------------------------------
+print TGFILE "// fapiHwpReasonCodes.H\n";
+print TGFILE "// This file is generated by perl script fapiCreateHwpErrorTags.pl\n\n";
+print TGFILE "#ifndef FAPIHWPREASONCODES_H_\n";
+print TGFILE "#define FAPIHWPREASONCODES_H_\n\n";
+print TGFILE "#include <fapiHwpReturnCodes.H>\n\n";
+print TGFILE "namespace fapi\n";
+print TGFILE "{\n\n";
+print TGFILE "enum hwpReasonCode\n";
+print TGFILE "{\n";
+
+#------------------------------------------------------------------------------
+# For each XML file
+#------------------------------------------------------------------------------
+foreach my $argnum (1 .. $#ARGV)
+{
+ #--------------------------------------------------------------------------
+ # Read XML file
+ #--------------------------------------------------------------------------
+ my $infile = $ARGV[$argnum];
+ my $errors = $xml->XMLin($infile);
+
+ # Uncomment to get debug output of all errors
+ #print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
+
+ #--------------------------------------------------------------------------
+ # For each Error
+ #--------------------------------------------------------------------------
+ foreach my $err (@{$errors->{hwpError}})
+ {
+ #----------------------------------------------------------------------
+ # Check that expected fields are present
+ #----------------------------------------------------------------------
+ if (! exists $err->{rc})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. rc missing\n");
+ exit(1);
+ }
+
+ if (! exists $err->{description})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. description missing\n");
+ exit(1);
+ }
+
+ #----------------------------------------------------------------------
+ # Print the ReasonCode
+ #----------------------------------------------------------------------
+ print TGFILE " __$err->{rc} = HWPF_COMP_ID | $err->{rc},\n";
+ }
+}
+
+#------------------------------------------------------------------------------
+# Print end of reason code enumeration and fapi namespace
+#------------------------------------------------------------------------------
+print TGFILE "};\n\n";
+print TGFILE "}\n\n";
+
+#------------------------------------------------------------------------------
+# For each XML file
+#------------------------------------------------------------------------------
+foreach my $argnum (1 .. $#ARGV)
+{
+ #--------------------------------------------------------------------------
+ # Read XML file
+ #--------------------------------------------------------------------------
+ my $infile = $ARGV[$argnum];
+ my $errors = $xml->XMLin($infile);
+
+ #--------------------------------------------------------------------------
+ # For each Error
+ #--------------------------------------------------------------------------
+ foreach my $err (@{$errors->{hwpError}})
+ {
+ #----------------------------------------------------------------------
+ # Print the Error Log tag
+ #----------------------------------------------------------------------
+ print TGFILE "/*\@\n";
+ print TGFILE " * \@errortype\n";
+ print TGFILE " * \@moduleid MOD_HWP_RC_TO_ERRL\n";
+ print TGFILE " * \@reasoncode __$err->{rc}\n";
+ print TGFILE " * \@devdesc $err->{description}\n";
+ print TGFILE " */\n\n";
+ }
+}
+
+#------------------------------------------------------------------------------
+# Print end of file information
+#------------------------------------------------------------------------------
+print TGFILE "#endif\n";
+
+#------------------------------------------------------------------------------
+# Close output files
+#------------------------------------------------------------------------------
+close(TGFILE);
+
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index 6ba6beebd..7a31ca610 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -143,24 +143,22 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
FAPI_ERR("fapiRcToErrl: HWP error: 0x%x",
static_cast<uint32_t>(io_rc));
- // TODO What should the severity be? Should it be in the error
- // record
- /*@
- * @errortype
- * @moduleid MOD_RC_TO_ERRL
- * @reasoncode RC_HWP_ERROR
- * @userdata1 Return Code Value
- * @devdesc Error from HWP
- */
+ // TODO What should the severity be? Should it be in the error info?
+
+ // The errlog reason code is the HWPF compID and the rcValue LSB
+ uint32_t l_rcValue = static_cast<uint32_t>(io_rc);
+ uint16_t l_reasonCode = l_rcValue;
+ l_reasonCode &= 0xff;
+ l_reasonCode |= HWPF_COMP_ID;
+
+ // HostBoot errlog tags for HWP errors are in generated file
+ // fapiHwpReasonCodes.H
l_pError = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_RC_TO_ERRL,
- RC_HWP_ERROR,
- static_cast<uint32_t>(io_rc));
+ MOD_HWP_RC_TO_ERRL,
+ l_reasonCode);
// Get the Error Information Pointer
- const ErrorInfo * l_pErrorInfo = NULL;
-
- l_pErrorInfo = io_rc.getErrorInfo();
+ const ErrorInfo * l_pErrorInfo = io_rc.getErrorInfo();
if (l_pErrorInfo)
{
@@ -180,17 +178,26 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
// FAPI error. Create an error log
FAPI_ERR("fapiRcToErrl: FAPI error: 0x%x",
static_cast<uint32_t>(io_rc));
- /*@
- * @errortype
- * @moduleid MOD_RC_TO_ERRL
- * @reasoncode RC_FAPI_ERROR
- * @userdata1 Return Code Value
- * @devdesc FAPI Error
- */
+
+ // The errlog reason code is the HWPF compID and the rcValue LSB
+ uint32_t l_rcValue = static_cast<uint32_t>(io_rc);
+ uint16_t l_reasonCode = l_rcValue;
+ l_reasonCode &= 0xff;
+ l_reasonCode |= HWPF_COMP_ID;
+
+ // HostBoot errlog tags for FAPI errors are in fapiPlatReasonCodes.H
l_pError = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- MOD_RC_TO_ERRL,
- RC_FAPI_ERROR,
- static_cast<uint32_t>(io_rc));
+ MOD_FAPI_RC_TO_ERRL,
+ l_reasonCode);
+
+ // FAPI may have added FFDC Error Information.
+ // Get the Error Information Pointer
+ const ErrorInfo * l_pErrorInfo = io_rc.getErrorInfo();
+
+ if (l_pErrorInfo)
+ {
+ processEIFfdcs(*l_pErrorInfo, l_pError);
+ }
}
// Set the ReturnCode to success, this will delete any ErrorInfo or PLAT
OpenPOWER on IntegriCloud