diff options
author | Brian Horton <brianh@linux.ibm.com> | 2013-02-26 16:40:57 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-03-13 09:26:19 -0500 |
commit | 436bc524c3cada8c1c5c9c64e4c173a77f195410 (patch) | |
tree | df10a266e972b59fc6470a33ede7d7282e10d0a0 /src | |
parent | 19d913c39aa031f0f88828b09d581503c7cbdcf2 (diff) | |
download | blackbird-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.tar.gz blackbird-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.zip |
update user-detail errog log parsers
update errolog parsers to format the data for the following:
. errludtarget
. errludattribute
. errludlogregister
. errludcallout
Change-Id: I8fddb3eefd76413e70f4e894ef19649b74682859
RTC: 41707
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3350
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/build/mkrules/dist.targets.mk | 4 | ||||
-rw-r--r-- | src/include/usr/devicefw/driverif.H | 8 | ||||
-rw-r--r-- | src/include/usr/devicefw/userif.H | 4 | ||||
-rw-r--r-- | src/include/usr/errl/errludtarget.H | 75 | ||||
-rw-r--r-- | src/include/usr/hwas/common/hwasCallout.H | 129 | ||||
-rw-r--r-- | src/usr/errl/errludlogregister.C | 37 | ||||
-rw-r--r-- | src/usr/errl/errludtarget.C | 77 | ||||
-rw-r--r-- | src/usr/errl/makefile | 31 | ||||
-rw-r--r-- | src/usr/errl/parser/makefile | 2 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludcallout.H | 140 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludlogregister.H | 143 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludtarget.H | 251 | ||||
-rw-r--r-- | src/usr/errl/test/errltest.H | 2 | ||||
-rw-r--r-- | src/usr/errl/test/errluserdetailtest.H | 10 | ||||
-rw-r--r-- | src/usr/hwas/common/hwasCallout.C | 47 | ||||
-rw-r--r-- | src/usr/targeting/common/target.C | 26 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/common.mk | 20 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 666 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/makefile | 13 |
19 files changed, 935 insertions, 750 deletions
diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk index ff2b5179c..7c26cf800 100644 --- a/src/build/mkrules/dist.targets.mk +++ b/src/build/mkrules/dist.targets.mk @@ -184,8 +184,12 @@ fsp.tar_CONTENTS = \ src/build/tools/hwp_id.pl \ obj/genfiles/plugins/makefile:plugins/ \ obj/genfiles/plugins/hbfwUdIds.H:plugins/ \ + src/include/usr/hwas/common/hwasCallout.H:hwas/ \ + src/include/usr/devicefw/driverif.H:devicefw/ \ + src/include/usr/devicefw/userif.H:devicefw/ \ obj/genfiles/plugins/fapiPlatHwpErrParser.H:plugins/ \ obj/genfiles/plugins/errludattribute.H:plugins/ \ + obj/genfiles/plugins/errludtarget.H:plugins/ \ $(addsuffix :plugins/,\ $(call ROOTPATH_WILDCARD,obj/genfiles/plugins/hbfwSrcParse*.C)) \ $(addsuffix :plugins/,\ diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H index f90223a54..fa33e26b1 100644 --- a/src/include/usr/devicefw/driverif.H +++ b/src/include/usr/devicefw/driverif.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -30,11 +30,15 @@ #ifndef __DEVICEFW_DRIVERIF #define __DEVICEFW_DRIVERIF +#ifndef PARSER + #include <devicefw/userif.H> #include <stdarg.h> #include <builtins.h> #include <targeting/common/targetservice.H> +#endif // not PARSER + namespace DeviceFW { /** @enum AccessType_DriverOnly @@ -74,6 +78,7 @@ namespace DeviceFW WILDCARD = -1, }; +#ifndef PARSER /** Construct the device addressing parameters for FSISCOM device ops. * @param[in] i_address - FSISCOM address to operate on. */ @@ -344,6 +349,7 @@ namespace DeviceFW TARGETING::Target* i_target, void* io_buffer, size_t& io_buflen, AccessType_DriverOnly i_accessType, va_list i_args); +#endif // not PARSER }; #endif diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 7fbad5d74..f7708568b 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -31,9 +31,11 @@ #ifndef __DEVICEFW_USERIF #define __DEVICEFW_USERIF +#ifndef PARSER #include <stdint.h> #include <errl/errlentry.H> #include <targeting/common/targetservice.H> +#endif // not PARSER namespace DeviceFW { @@ -55,6 +57,7 @@ namespace DeviceFW LAST_ACCESS_TYPE, }; +#ifndef PARSER /** Construct the device addressing parameters for SCOM device ops. * @param[in] i_address - Scom address to operate on. */ @@ -193,6 +196,7 @@ namespace DeviceFW errlHndl_t deviceWrite(TARGETING::Target* i_target, void* i_buffer, size_t& io_buflen, AccessType i_accessType, ...); +#endif // not PARSER }; diff --git a/src/include/usr/errl/errludtarget.H b/src/include/usr/errl/errludtarget.H deleted file mode 100644 index 67ba891c3..000000000 --- a/src/include/usr/errl/errludtarget.H +++ /dev/null @@ -1,75 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/errl/errludtarget.H $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,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 */ -#ifndef ERRL_UDTARGET_H -#define ERRL_UDTARGET_H - -/** - * @file errludTarget.H - * - * Defines the ErrlUserDetailsTarget class that adds target FFDC to an - * error log as user detail data - */ - -#include <errl/errluserdetails.H> - -// Forward reference -namespace TARGETING -{ - class Target; -} - -namespace ERRORLOG -{ - -/** - * @class ErrlUserDetailsTarget - * - * Adds Target FFDC to an error log as user detail data -*/ -class ErrlUserDetailsTarget : public ErrlUserDetails -{ -public: - /** - * @brief Constructor - * - * Captures the supplied Target's FFDC data internally - * - * @param i_pTarget Pointer to Target to capture as user detail data - */ - ErrlUserDetailsTarget(const TARGETING::Target * i_pTarget); - - /** - * @brief Destructor - */ - virtual ~ErrlUserDetailsTarget(); - -private: - // Disabled - ErrlUserDetailsTarget(const ErrlUserDetailsTarget &); - ErrlUserDetailsTarget & operator=(const ErrlUserDetailsTarget &); -}; - -} - -#endif - diff --git a/src/include/usr/hwas/common/hwasCallout.H b/src/include/usr/hwas/common/hwasCallout.H index 2b7302146..439b79fdd 100644 --- a/src/include/usr/hwas/common/hwasCallout.H +++ b/src/include/usr/hwas/common/hwasCallout.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/include/usr/hwas/common/hwasCallout.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * 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_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwas/common/hwasCallout.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,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 */ #ifndef __HWAS_HWASCALLOUT_H #define __HWAS_HWASCALLOUT_H /** @@ -33,7 +32,9 @@ /******************************************************************************/ // Includes /******************************************************************************/ +#ifndef PARSER #include <targeting/common/target.H> +#endif // not PARSER namespace HWAS { @@ -91,86 +92,23 @@ enum epubProcedureID { EPUB_PRC_NONE = 0x00, EPUB_PRC_FIND_DECONFIGURED_PART = 0x01, - EPUB_PRC_EARLY_TERM = 0x02, - EPUB_PRC_USER_ERR = 0x03, EPUB_PRC_SP_CODE = 0x04, EPUB_PRC_PHYP_CODE = 0x05, - EPUB_PRC_INT_PROB = 0x06, - EPUB_PRC_TOD_PROB = 0x07, EPUB_PRC_ALL_PROCS = 0x08, EPUB_PRC_ALL_MEMCRDS = 0x09, EPUB_PRC_INVALID_PART = 0x0A, - EPUB_PRC_RIO_PORTX = 0x0B, - EPUB_PRC_DIMM_CONNECTOR = 0x0C, - EPUB_PRC_FNM_CODE = 0x0D, - EPUB_PRC_WAIT_FOR_PHYP = 0x0E, - EPUB_PRC_SMA_CODE = 0x0F, EPUB_PRC_LVL_SUPP = 0x10, - EPUB_PRC_SUE_PREVERROR = 0x11, - EPUB_PRC_CODE_UPDATE = 0x12, - EPUB_PRC_PLUG_COUNT_EXCEED = 0x13, - EPUB_PRC_SYSUNIT = 0x14, - EPUB_PRC_IOPATH = 0x15, EPUB_PRC_PROCPATH = 0x16, - EPUB_PRC_FIPS_DUMP = 0x17, - EPUB_PRC_REBOOT = 0x18, - EPUB_PRC_THERMAL_FAULT = 0x19, - EPUB_PRC_BACKPLANE = 0x1A, - EPUB_PRC_ATTN_LINE = 0x1B, EPUB_PRC_NO_VPD_FOR_FRU = 0x1C, - EPUB_PRC_IOBRIDGE = 0x1D, - EPUB_PRC_ANCHOR = 0x1E, - EPUB_PRC_SYSTEM_VPD = 0x1F, - EPUB_PRC_ENCLOSURE_VPD = 0x20, - EPUB_PRC_SURV_HMC_ERROR = 0x21, EPUB_PRC_MEMORY_PLUGGING_ERROR = 0x22, - EPUB_PRC_MEM_SCRUB_REBOOT = 0x23, - EPUB_PRC_SMP_CABLE = 0x24, - EPUB_PRC_MS_PROC_TIMEOUT = 0x25, - EPUB_PRC_JTAG_PATH = 0x26, - EPUB_PRC_MNFG_DIMM_ISOLATION = 0x27, - EPUB_PRC_LOGAUTH_WARN = 0x28, - EPUB_PRC_IIC_BUS_ISOLATION = 0x29, - EPUB_PRC_FABRIC_ISOLATION = 0x2A, - EPUB_PRC_STATIC_IP = 0x2B, - EPUB_PRC_MUX_CARD = 0x2C, EPUB_PRC_FSI_PATH = 0x2D, - EPUB_PRC_SERV_PROC = 0x2E, - EPUB_PRC_PSI_LINK = 0x2F, EPUB_PRC_PROC_AB_BUS = 0x30, EPUB_PRC_PROC_XYZ_BUS = 0x31, - EPUB_PRC_GX_SLOT = 0x32, - EPUB_PRC_MEMBUS_REPAIR = 0x33, EPUB_PRC_MEMBUS_ERROR = 0x34, - EPUB_PRC_NET_SWITCH = 0x35, - EPUB_PRC_OVER_TEMP = 0x36, EPUB_PRC_EIBUS_ERROR = 0x37, - EPUB_PRC_CCM_VPD_CARD = 0x38, - EPUB_PRC_HOST_ONE_NETWORK = 0x39, - EPUB_PRC_NET_CABLE_MISPLUG = 0x3A, - EPUB_PRC_NET_DATA_NOT_AVAILABLE = 0x3B, - EPUB_PRC_MAC_ADDRESS_DUP = 0x3C, - EPUB_PRC_INVALID_HUB_CONNECTION = 0x3D, - EPUB_PRC_MISSING_NODE = 0x3E, EPUB_PRC_POWER_ERROR = 0x3F, - EPUB_PRC_NO_LINKS = 0x40, - EPUB_PRC_BAD_IP_SUBNET = 0x41, - EPUB_PRC_RFSP = 0x42, - EPUB_PRC_STANDBY_POWR = 0x43, - EPUB_PRC_FSP_LVL_SUPP = 0x44, - EPUB_PRC_BALANCED_MEMORY = 0x45, - EPUB_PRC_CHECK_POWR_SRCS = 0x46, - EPUB_PRC_BPC_PROC = 0x47, - EPUB_PRC_BLADE_LNK_DWN = 0x48, - EPUB_PRC_WRAP_PRBS = 0x49, - EPUB_PRC_PRBS_SWRAP = 0x4A, - EPUB_PRC_INVALID_IP = 0x4B, - EPUB_PRC_CCIN_NOT_FOUND = 0x4C, EPUB_PRC_PERFORMANCE_DEGRADED = 0x4D, - EPUB_PRC_WKP_FAIL = 0x4E, - EPUB_PRC_MEMORY_UE = 0x4F, - EPUB_PRC_PLATFORM_CODE = 0x50, - EPUB_PRC_MAX + EPUB_PRC_HB_CODE = 0x51 }; // from srci/fsp/srci.H @@ -184,6 +122,7 @@ enum callOutPriority SRCI_PRIORITY_HIGH = 6 }; +#ifndef PARSER /** * @brief processCallout process the userdetail for a callout, calling @@ -201,6 +140,7 @@ void processCallout(const uint32_t i_errlPlid, // typedef for function pointer that the errlog class will use. typedef void (*processCalloutFn)(const uint32_t, uint8_t *, uint64_t); +#endif // not PARSER // const uint8_t HW_CALLOUT = 0x01; @@ -211,18 +151,19 @@ const uint8_t TARGET_IS_SENTINEL = 0xF0; typedef struct callout_ud { uint8_t type; - callOutPriority priority; // uint8_t + uint8_t pad[3]; + callOutPriority priority; // uint32_t union { struct { // deconfigure / gard - DeconfigEnum deconfigState; // uint8_t - GARD_ErrorType gardErrorType; // uint8_t + DeconfigEnum deconfigState; // uint32_t + GARD_ErrorType gardErrorType; // uint32_t uint32_t cpuid; - } __attribute__((packed)); + }; struct { // callout - epubProcedureID procedure; // uint8_t - } __attribute__((packed)); + epubProcedureID procedure; // uint32_t + }; }; -} __attribute__((packed)) callout_ud_t; +} callout_ud_t; }; // end namespace diff --git a/src/usr/errl/errludlogregister.C b/src/usr/errl/errludlogregister.C index 722b3680a..244b8d5ec 100644 --- a/src/usr/errl/errludlogregister.C +++ b/src/usr/errl/errludlogregister.C @@ -53,10 +53,15 @@ void ErrlUserDetailsLogRegister::setStateLogHUID() // write the HUID of the target into the error log buffer uint32_t attrHuid = get_huid(iv_pTarget); - char *pBuf; - pBuf = reinterpret_cast<char *>(reallocUsrBuf(sizeof(attrHuid))); - memcpy(pBuf, &attrHuid, sizeof(attrHuid)); - iv_dataSize += sizeof(attrHuid); + uint8_t *pBuf = reinterpret_cast<uint8_t *> + (reallocUsrBuf(sizeof(uint32_t) + sizeof(uint8_t))); + memcpy(pBuf, &attrHuid, sizeof(uint32_t)); + iv_dataSize += sizeof(uint32_t); + + // add space for the count and initialize to 0 +#define REGISTER_COUNT_OFFSET (sizeof(uint32_t)) + *(pBuf + REGISTER_COUNT_OFFSET) = 0; + iv_dataSize += sizeof(uint8_t); } // setStateLogHUID @@ -97,6 +102,10 @@ void ErrlUserDetailsLogRegister::writeRegisterData( memcpy(pBuf + iv_dataSize, i_dataBuf, i_dataSize); iv_dataSize += i_dataSize; } + + // increment the count + *(pBuf + REGISTER_COUNT_OFFSET) += 1; + } // writeRegisterData // internal function: @@ -107,7 +116,7 @@ void ErrlUserDetailsLogRegister::readRegister( // (DeviceFW::PRESENT is an example, but we chose not to log that type) int32_t numAddressArgs = -1; - // do we do the deviceOpValist or not, and how many + // do we do the deviceOpValist or not, and how many // parameters are there to be logged switch (i_accessType) { @@ -165,14 +174,17 @@ void ErrlUserDetailsLogRegister::readRegister( i_accessType); delete errl; // eat the error - just delete it - reg_size = 0; // in case deviceOpValist didn't reset + // nothing gets written out + } + else + { + // internal worker function to put reg data into the log + writeRegisterData(®_data, reg_size, numAddressArgs, + i_accessType, i_args); + TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize); } - - // internal worker function to put reg data into the log - writeRegisterData(®_data, reg_size, numAddressArgs, - i_accessType, i_args); - TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize); } + // else: nothing gets written out } // readRegister // internal function: @@ -184,7 +196,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData( // (DeviceFW::PRESENT is an example, but we chose not to log that type) int32_t numAddressArgs = -1; - // do we do the deviceOpValist or not, and how many + // do we do the deviceOpValist or not, and how many // parameters are there to be logged switch (i_accessType) { @@ -230,6 +242,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData( i_accessType, i_args); TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize); } + // else: nothing gets written out } // copyRegisterData //------------------------------------------------------------------------------ diff --git a/src/usr/errl/errludtarget.C b/src/usr/errl/errludtarget.C deleted file mode 100644 index 4d36f5e7a..000000000 --- a/src/usr/errl/errludtarget.C +++ /dev/null @@ -1,77 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/errl/errludtarget.C $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,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 errludtarget.C - * - * @brief Implementation of ErrlUserDetailsTarget - */ -#include <errl/errludtarget.H> -#include <errl/errlreasoncodes.H> -#include <targeting/common/target.H> -#include <targeting/common/targetservice.H> -#include <targeting/common/trace.H> - -namespace ERRORLOG -{ - -//------------------------------------------------------------------------------ -ErrlUserDetailsTarget::ErrlUserDetailsTarget( - const TARGETING::Target * i_pTarget) -{ - // Set up ErrlUserDetails instance variables - iv_CompId = ERRL_COMP_ID; - iv_Version = 1; - iv_SubSection = ERRL_UDT_TARGET; - - // override the default of false. - //iv_merge = true; - // TODO until the errlparser tool is fixed and the errludtarget parse() - // function can be fully tested and debugged, we'll leave this as false - // so that the records are NOT merged to make it less confusing. - iv_merge = false; - - if (i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) - { - uint8_t *pBuffer = reinterpret_cast<uint8_t *>( - reallocUsrBuf(sizeof(uint8_t))); - // copy 0x1 to indicate MASTER - *pBuffer = 1; - } - else - { - uint32_t bufSize = 0; - uint8_t *pTargetString = i_pTarget->targetFFDC(bufSize); - uint8_t *pBuffer = reinterpret_cast<uint8_t *>(reallocUsrBuf(bufSize)); - memcpy(pBuffer, pTargetString, bufSize); - free (pTargetString); - } -} - -//------------------------------------------------------------------------------ -ErrlUserDetailsTarget::~ErrlUserDetailsTarget() -{ - -} - -} - diff --git a/src/usr/errl/makefile b/src/usr/errl/makefile index 7ce89dc70..6535ef642 100644 --- a/src/usr/errl/makefile +++ b/src/usr/errl/makefile @@ -1,25 +1,25 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/usr/errl/makefile $ +# $Source: src/usr/errl/makefile $ # -# IBM CONFIDENTIAL +# IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011-2012 +# COPYRIGHT International Business Machines Corp. 2011,2013 # -# p1 +# p1 # -# Object Code Only (OCO) source materials -# Licensed Internal Code Source Materials -# IBM HostBoot Licensed Internal Code +# 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. +# 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 +# Origin: 30 # -# IBM_PROLOG_END_TAG +# IBM_PROLOG_END_TAG ROOTPATH = ../../.. MODULE = errl @@ -32,5 +32,6 @@ SUBDIRS = test.d parser.d include ${ROOTPATH}/config.mk -# to find errludattribute.C and .H +# to find errludattribute.[CH] and errludtarget.[CH] - they are generated +# by src/usr/targeting/common/xmltohb/xmltohb.pl vpath %.C ${GENDIR} diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile index 10a4060ee..386ab9b5e 100644 --- a/src/usr/errl/parser/makefile +++ b/src/usr/errl/parser/makefile @@ -61,7 +61,7 @@ CODE_PASS: ${IMGDIR}/errlparser mkdirs: mkdir -p ${OBJDIR} - mkdir -p ${GENDIR} + mkdir -p ${GENDIR}/plugins # Generate error log parser code ${ERRLPARSE_TARGETS} : gen_errl_parsers diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H index 3346c6487..a4d7590a8 100644 --- a/src/usr/errl/plugins/errludcallout.H +++ b/src/usr/errl/plugins/errludcallout.H @@ -31,6 +31,8 @@ */ #include "errluserdetails.H" +#include "errludtarget.H" // for errlud_parse_entity_path() +#include "../hwas/common/hwasCallout.H" namespace ERRORLOG { @@ -66,9 +68,141 @@ public: void * i_pBuffer, const uint32_t i_buflen) const { - // TODO fix when parser fixed - // RTC 41707 - } + HWAS::callout_ud_t *pData; + pData = static_cast<HWAS::callout_ud_t *>(i_pBuffer); + + switch (pData->type) + { + case HWAS::HW_CALLOUT: + { + i_parser.PrintString( "Callout type", "Hardware Callout"); + + // what follows the pData structure is an entity path + // print it first + uint8_t *l_ptr = reinterpret_cast<uint8_t *>(pData+1); + if (*l_ptr == 0xF0) + { + i_parser.PrintString("Target", + "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); + } + else + { + char outString[128]; + l_ptr = errlud_parse_entity_path(l_ptr, outString); + i_parser.PrintString("Target", outString); + } + + i_parser.PrintNumber( "CPU id", "0x%X", ntohl(pData->cpuid) ); + + switch (ntohl(pData->deconfigState)) + { +#define case_DECONFIG_STATE(_type) \ +case HWAS::_type: i_parser.PrintString( "Deconfig State", #_type); break; + case_DECONFIG_STATE(NO_DECONFIG) + case_DECONFIG_STATE(DECONFIG) + case_DECONFIG_STATE(DELAYED_DECONFIG) + default: + i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", + ntohl(pData->deconfigState) ); + break; + } // switch deconfigState + + switch (ntohl(pData->gardErrorType)) + { +#define case_GARD_ERROR_TYPE(_type) \ +case HWAS::_type: i_parser.PrintString( "GARD Error Type", #_type); break; + case_GARD_ERROR_TYPE(GARD_NULL) + case_GARD_ERROR_TYPE(GARD_Pending) + case_GARD_ERROR_TYPE(GARD_PendingCmplt) + case_GARD_ERROR_TYPE(GARD_Unrecoverable) + case_GARD_ERROR_TYPE(GARD_Fatal) + case_GARD_ERROR_TYPE(GARD_Fabric) + case_GARD_ERROR_TYPE(GARD_Computation) + case_GARD_ERROR_TYPE(GARD_ComputationCmplt) + case_GARD_ERROR_TYPE(GARD_Predictive) + case_GARD_ERROR_TYPE(GARD_PredictiveCmplt) + case_GARD_ERROR_TYPE(GARD_ByAssociation) + case_GARD_ERROR_TYPE(GARD_ResourceRecovery) + case_GARD_ERROR_TYPE(GARD_Cmplt) + case_GARD_ERROR_TYPE(GARD_Func) + case_GARD_ERROR_TYPE(GARD_FuncCmplt) + case_GARD_ERROR_TYPE(GARD_DmaRecoverable) + case_GARD_ERROR_TYPE(GARD_DmaUnrecoverable) + case_GARD_ERROR_TYPE(GARD_Tod) + case_GARD_ERROR_TYPE(GARD_TodCmplt) + case_GARD_ERROR_TYPE(GARD_Slb) + case_GARD_ERROR_TYPE(GARD_SlbCmplt) + case_GARD_ERROR_TYPE(GARD_ProcRecoverable) + case_GARD_ERROR_TYPE(GARD_ProcRecoverableCmplt) + case_GARD_ERROR_TYPE(GARD_TimeFac) + case_GARD_ERROR_TYPE(GARD_TimeFacCmplt) + case_GARD_ERROR_TYPE(GARD_GxBusError) + case_GARD_ERROR_TYPE(GARD_PowerBusError) + case_GARD_ERROR_TYPE(GARD_Withheld) + case_GARD_ERROR_TYPE(GARD_PoreError) + case_GARD_ERROR_TYPE(GARD_NxError) + case_GARD_ERROR_TYPE(GARD_Void) + default: + i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", + ntohl(pData->gardErrorType) ); + break; + } // switch deconfigState + + break; // HW_CALLOUT + } + case HWAS::PROCEDURE_CALLOUT: + i_parser.PrintString( "Callout type", "Procedure Callout"); + switch (ntohl(pData->procedure)) + { +#define case_PROCEDURE(_type) \ +case HWAS::_type: i_parser.PrintString( "Procedure", #_type); break; + case_PROCEDURE(EPUB_PRC_NONE) + case_PROCEDURE(EPUB_PRC_FIND_DECONFIGURED_PART) + case_PROCEDURE(EPUB_PRC_SP_CODE) + case_PROCEDURE(EPUB_PRC_PHYP_CODE) + case_PROCEDURE(EPUB_PRC_ALL_PROCS) + case_PROCEDURE(EPUB_PRC_ALL_MEMCRDS) + case_PROCEDURE(EPUB_PRC_INVALID_PART) + case_PROCEDURE(EPUB_PRC_LVL_SUPP) + case_PROCEDURE(EPUB_PRC_PROCPATH) + case_PROCEDURE(EPUB_PRC_NO_VPD_FOR_FRU) + case_PROCEDURE(EPUB_PRC_MEMORY_PLUGGING_ERROR) + case_PROCEDURE(EPUB_PRC_FSI_PATH) + case_PROCEDURE(EPUB_PRC_PROC_AB_BUS) + case_PROCEDURE(EPUB_PRC_PROC_XYZ_BUS) + case_PROCEDURE(EPUB_PRC_MEMBUS_ERROR) + case_PROCEDURE(EPUB_PRC_EIBUS_ERROR) + case_PROCEDURE(EPUB_PRC_POWER_ERROR) + case_PROCEDURE(EPUB_PRC_PERFORMANCE_DEGRADED) + case_PROCEDURE(EPUB_PRC_HB_CODE) + default: + i_parser.PrintNumber( "Procedure", "UNKNOWN: 0x%X", + ntohl(pData->procedure) ); + break; + } // switch procedure + break; // PROCEDURE_CALLOUT + default: + i_parser.PrintNumber( "Callout type", "UNKNOWN: 0x%X", + ntohl(pData->type) ); + break; + } // switch type + + switch (ntohl(pData->priority)) + { +#define case_PRIORITY(_type) \ +case HWAS::_type: i_parser.PrintString( "Priority", #_type); break; + case_PRIORITY(SRCI_PRIORITY_LOW) + case_PRIORITY(SRCI_PRIORITY_MEDC) + case_PRIORITY(SRCI_PRIORITY_MEDB) + case_PRIORITY(SRCI_PRIORITY_MEDA) + case_PRIORITY(SRCI_PRIORITY_MED) + case_PRIORITY(SRCI_PRIORITY_HIGH) + default: + i_parser.PrintNumber( "Priority", "UNKNOWN: 0x%X", + ntohl(pData->priority) ); + break; + } // switch priority + } // parse private: // Disabled diff --git a/src/usr/errl/plugins/errludlogregister.H b/src/usr/errl/plugins/errludlogregister.H index f7f19ae2d..79aa8ba04 100644 --- a/src/usr/errl/plugins/errludlogregister.H +++ b/src/usr/errl/plugins/errludlogregister.H @@ -32,6 +32,9 @@ #include "errluserdetails.H" +#include <../devicefw/userif.H> +#include <../devicefw/driverif.H> + namespace ERRORLOG { @@ -66,9 +69,143 @@ public: void * i_pBuffer, const uint32_t i_buflen) const { - // TODO fix when parser if fix - // RTC 41707 - } + uint8_t *pBuf = reinterpret_cast<uint8_t *>(i_pBuffer); + + // while there is still at least 1 word of data left + for (; (pBuf + sizeof(uint32_t)) <= ((uint8_t*)i_pBuffer + i_buflen); ) + { + // first is the HUID + uint32_t *pData = reinterpret_cast<uint32_t *>(pBuf); + if (ntohl(*pData) == 0xFFFFFFFF) + { + i_parser.PrintString("LogRegister", + "Target: MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); + } + else + { + i_parser.PrintNumber( "LogRegister", + "Target: HUID = 0x%08X", ntohl(*pData) ); + } + pData++; + pBuf += sizeof(*pData); + + // next is the count of registers to dump + const uint8_t count = *pBuf; + pBuf++; + + for (uint32_t i = 0; i < count;i++) + { + // format of data in the buffer is: + // i_accessType, regParam[i], uint8_t(i_dataSize), i_dataBuf + uint8_t l_accessType = *pBuf; + pBuf++; + int32_t numArgs = -1; + std::vector <const char *> addrParams; + switch (l_accessType) + { + // one parameter + case DeviceFW::SCOM: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::SCOM"); + numArgs = 1; + addrParams.push_back(" Scom address"); + break; + case DeviceFW::FSI: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::FSI"); + numArgs = 1; + addrParams.push_back(" FSI address"); + break; + case DeviceFW::SPD: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::SPD"); + numArgs = 1; + addrParams.push_back(" SPD keyword enumaration"); + break; + case DeviceFW::XSCOM: // driverif.H + i_parser.PrintString("AccessType", "DeviceFW::XSCOM"); + numArgs = 1; + addrParams.push_back(" XScom address"); + break; + case DeviceFW::FSISCOM: // driverif.H + i_parser.PrintString("AccessType", "DeviceFW::FSISCOM"); + numArgs = 1; + addrParams.push_back(" FSISCOM address"); + break; + // two parameters + case DeviceFW::MVPD: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::MVPD"); + numArgs = 2; + addrParams.push_back(" MVPD record"); + addrParams.push_back(" MVPD keyword"); + break; + case DeviceFW::EEPROM: // driverif.H + i_parser.PrintString("AccessType", "DeviceFW::EEPROM"); + numArgs = 2; + addrParams.push_back(" I2C slave device address"); + addrParams.push_back(" EEPROM chip number"); + break; + // three parameters + case DeviceFW::I2C: // driverif.H + i_parser.PrintString("AccessType", "DeviceFW::I2C"); + numArgs = 3; + addrParams.push_back(" I2C port"); + addrParams.push_back(" I2C master engine"); + addrParams.push_back(" Device address"); + break; + // not logged! + case DeviceFW::PRESENT: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::PRESENT " + "- not logged"); + break; + case DeviceFW::PNOR: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::PNOR " + "- not logged"); + break; + case DeviceFW::MAILBOX: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::MAILBOX " + "- not logged"); + break; + case DeviceFW::CVPD: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::CVPD " + "- not logged"); + break; + case DeviceFW::SCAN: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::SCAN " + "- not logged"); + break; + case DeviceFW::IBSCOM: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::IBSCOM " + "- not logged"); + break; + default: + i_parser.PrintNumber("AccessType", "UNKNOWN 0x%X" + "- not logged", + l_accessType); + break; + } // switch l_accessType + + if (numArgs != -1) + { + uint64_t *pData64 = reinterpret_cast<uint64_t *>(pBuf); + for (int32_t i = 0;i < numArgs;i++) + { + std::vector<char> l_traceEntry(20); + sprintf(&(l_traceEntry[0]),"0x%016llX", ntohll(*pData64)); + i_parser.PrintString(addrParams[i], &(l_traceEntry[0])); + + pData64++; + pBuf += sizeof(*pData64); + } + const uint8_t dataSize = *pBuf; + i_parser.PrintNumber(" Register data", "size: 0x%X bytes", + dataSize); + pBuf++; + + pData64 = reinterpret_cast<uint64_t *>(pBuf); + i_parser.PrintHexDump( pData64, dataSize); + pBuf += dataSize; + } // numArgs + } // for count + } // for + } // parse private: // Disabled diff --git a/src/usr/errl/plugins/errludtarget.H b/src/usr/errl/plugins/errludtarget.H deleted file mode 100644 index 61a4d8cf9..000000000 --- a/src/usr/errl/plugins/errludtarget.H +++ /dev/null @@ -1,251 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/errl/plugins/errludtarget.H $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,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 */ -#ifndef ERRL_UDTARGET_H -#define ERRL_UDTARGET_H - -/** - * @file errludTarget.H - * - * Defines the ErrlUserDetailsParserTarget class that parses Target FFDC - * user detail in an error log - */ - -#include "errluserdetails.H" -#include <string.h> - -namespace ERRORLOG -{ - -/** - * @class ErrlUserDetailsParserTarget - * - * Parses Target FFDC user detail in an error log - */ -class ErrlUserDetailsParserTarget : public ErrlUserDetailsParser -{ -public: - /** - * @brief Constructor - */ - ErrlUserDetailsParserTarget() {} - - /** - * @brief Destructor - */ - virtual ~ErrlUserDetailsParserTarget() {} - - /** - * @brief Parses Target user detail data from an error log - * - * @param i_version Version of the data - * @param i_parse ErrlUsrParser object for outputting information - * @param i_pBuffer Pointer to buffer containing detail data - * @param i_buflen Length of the buffer - */ - virtual void parse(errlver_t i_version, - ErrlUsrParser & i_parser, - void * i_pBuffer, - const uint32_t i_buflen) const - { - i_parser.PrintString("Target data", NULL); - const char *attrData; - uint32_t i = 0; - - // errlog data - uint8_t *l_ptr = static_cast<uint8_t *>(i_pBuffer); - - // TODO: needs to be updated to handle merged records - - if (*l_ptr == 1) // special - master - { - i_parser.PrintString(NULL, "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); - } - else - { - l_ptr += sizeof(uint8_t); // past the marker - - // first 4 are always the same - if (i_buflen >= sizeof(uint32_t) + 3 * sizeof(uint8_t)) - { - char sHuid[12]; - sprintf(sHuid, "0x%x",*((uint32_t *)l_ptr)); - i_parser.PrintString("ATTR_HUID", sHuid); - i += sizeof(uint32_t); - l_ptr += sizeof(uint32_t); - - // CLASS - switch (*l_ptr) { - case 0x00: { attrData = "CLASS_NA"; break; } - case 0x01: { attrData = "CLASS_CARD"; break; } - case 0x02: { attrData = "CLASS_ENC"; break; } - case 0x03: { attrData = "CLASS_CHIP"; break; } - case 0x04: { attrData = "CLASS_UNIT"; break; } - case 0x05: { attrData = "CLASS_DEV"; break; } - case 0x06: { attrData = "CLASS_SYS"; break; } - case 0x07: { attrData = "CLASS_LOGICAL_CARD"; break; } - case 0x08: { attrData = "CLASS_MAX"; break; } - default: { attrData = "UNKNOWN CLASS"; break; } - } // switch - i_parser.PrintString("ATTR_CLASS", attrData); - i ++; - l_ptr ++; - - // TYPE - switch (*l_ptr) { - // TODO: RTC 50828: make these build-time dynamic based - // on values in obj/genfiles/attributeenums.H - case 0x00: { attrData = "TYPE_NA"; break; } - case 0x01: { attrData = "TYPE_SYS"; break; } - case 0x02: { attrData = "TYPE_NODE"; break; } - case 0x03: { attrData = "TYPE_DIMM"; break; } - case 0x04: { attrData = "TYPE_MEMBUF"; break; } - case 0x05: { attrData = "TYPE_PROC"; break; } - case 0x06: { attrData = "TYPE_EX"; break; } - case 0x07: { attrData = "TYPE_CORE"; break; } - case 0x08: { attrData = "TYPE_L2"; break; } - case 0x09: { attrData = "TYPE_L3"; break; } - case 0x0A: { attrData = "TYPE_L4"; break; } - case 0x0B: { attrData = "TYPE_MCS"; break; } - case 0x0C: { attrData = "TYPE_MBS"; break; } - case 0x0D: { attrData = "TYPE_MBA"; break; } - case 0x0E: { attrData = "TYPE_XBUS"; break; } - case 0x0F: { attrData = "TYPE_ABUS"; break; } - case 0x10: { attrData = "TYPE_PCI"; break; } - case 0x11: { attrData = "TYPE_DPSS"; break; } - case 0x12: { attrData = "TYPE_APSS"; break; } - case 0x13: { attrData = "TYPE_OCC"; break; } - case 0x14: { attrData = "TYPE_PSI"; break; } - case 0x15: { attrData = "TYPE_FSP"; break; } - case 0x16: { attrData = "TYPE_PNOR"; break; } - case 0x17: { attrData = "TYPE_LAST_IN_RANGE"; break; } - default: { attrData = "UNKNOWN TYPE"; break; } - } // switch - i_parser.PrintString("ATTR_TYPE", attrData); - i++; - l_ptr++; - - // MODEL - switch (*l_ptr) { - // TODO: RTC 50828: make these build-time dynamic based - // on values in obj/genfiles/attributeenums.H - case 0x00: { attrData = "MODEL_NA"; break; } - case 0x10: { attrData = "MODEL_RESERVED"; break; } - case 0x11: { attrData = "MODEL_VENICE"; break; } - case 0x12: { attrData = "MODEL_MURANO"; break; } - case 0x30: { attrData = "MODEL_CENTAUR"; break; } - case 0x50: { attrData = "MODEL_JEDEC"; break; } - case 0x51: { attrData = "MODEL_CDIMM"; break; } - case 0x70: { attrData = "MODEL_POWER8"; break; } - default: { attrData = "UNKNOWN MODEL"; break; } - } // switch - i_parser.PrintString("ATTR_MODEL", attrData); - i++; - l_ptr++; - } - -// TODO RTC 50828 The following for loop hangs -#if 0 - for (; i < i_buflen; ) - { - if ((*l_ptr == 0x15) || // ATTR_PHYS_PATH - (*l_ptr == 0x16)) // ATTR_AFFINITY_PATH - { - l_ptr++; - const char *pathString; - char outString[128]; - // from targeting/common/entitypath.[CH] - // entityPath is PATH_TYPE:4, NumberOfElements:4, - // [Element, Instance#] - // PATH_TYPE - const uint8_t pathTypeLength = *((uint8_t *)l_ptr); - l_ptr++; - const uint8_t pathType = (pathTypeLength & 0xF0) >> 4; - switch (pathType) { - case 0x01: pathString = "Logical:"; break; - case 0x02: pathString = "Physical:"; break; - case 0x03: pathString = "Device:"; break; - case 0x04: pathString = "Power:"; break; - default: pathString = "Unknown:"; break; - } - uint32_t dataSize = sprintf(outString, "%s",pathString); - const uint8_t pathSize = (pathTypeLength & 0x0F); - uint8_t *lElementInstance = ((uint8_t *)l_ptr); - l_ptr += pathSize * sizeof(uint8_t); - for (uint32_t j=0;j<pathSize;j += 2) { - switch (lElementInstance[j]) { - // TODO: RTC 50828: make these build-time dynamic based - // on values in obj/genfiles/attributeenums.H - case 0x01: pathString = "/Sys"; break; - case 0x02: pathString = "/Node"; break; - case 0x03: pathString = "/DIMM"; break; - case 0x04: pathString = "/Membuf"; break; - case 0x05: pathString = "/Proc"; break; - case 0x06: pathString = "/EX"; break; - case 0x07: pathString = "/Core"; break; - case 0x08: pathString = "/L2"; break; - case 0x09: pathString = "/L3"; break; - case 0x0A: pathString = "/L4"; break; - case 0x0B: pathString = "/MCS"; break; - case 0x0C: pathString = "/MBS"; break; - case 0x0D: pathString = "/MBA"; break; - case 0x0E: pathString = "/XBUS"; break; - case 0x0F: pathString = "/ABUS"; break; - case 0x10: pathString = "/PCI"; break; - case 0x11: pathString = "/DPSS"; break; - case 0x12: pathString = "/APSS"; break; - case 0x13: pathString = "/OCC"; break; - case 0x14: pathString = "/PSI"; break; - case 0x15: pathString = "/FSP"; break; - case 0x16: pathString = "/PNOR"; break; - default: pathString = "/Unknown"; break; - } // switch - // copy next part in, overwritting previous terminator - dataSize += sprintf(outString + dataSize, - "%s%d", pathString, - lElementInstance[j+1]); - } // for - if (*l_ptr == 0x15) // ATTR_PHYS_PATH - { - i_parser.PrintString("ATTR_PHYS_PATH", outString); - } - else - { - i_parser.PrintString("ATTR_AFFINITY_PATH", outString); - } - } - } // for -#endif - } - } // parse() - -private: - // Disabled - ErrlUserDetailsParserTarget(const ErrlUserDetailsParserTarget &); - ErrlUserDetailsParserTarget & operator=( - const ErrlUserDetailsParserTarget &); -}; - -} - -#endif - diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 598d29b01..f02a8ca98 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -435,7 +435,7 @@ public: // SENTINEL not logged properly // deconfigCount++; errl->addProcedureCallout( - HWAS::EPUB_PRC_MEMORY_UE, + HWAS::EPUB_PRC_MEMORY_PLUGGING_ERROR, HWAS::SRCI_PRIORITY_HIGH); errlCommit(errl, CXXTEST_COMP_ID); diff --git a/src/usr/errl/test/errluserdetailtest.H b/src/usr/errl/test/errluserdetailtest.H index 825ff5e49..9349d82e8 100644 --- a/src/usr/errl/test/errluserdetailtest.H +++ b/src/usr/errl/test/errluserdetailtest.H @@ -39,7 +39,7 @@ #include <errl/errludtarget.H> #include <errl/errludlogregister.H> #include <errl/errludcallout.H> -#include <errludattribute.H> +#include <errl/errludattribute.H> #include <targeting/common/targetservice.H> #include <targeting/common/iterators/rangefilter.H> #include <targeting/common/predicates/predicates.H> @@ -142,17 +142,17 @@ public: c_target = *pProc; TS_TRACE( "testAttribute pProc %p", c_target); ErrlUserDetailsTarget(c_target).addToLog(errl); - ErrlUserDetailsTarget( - TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL).addToLog(errl); // all attributes ErrlUserDetailsAttribute(c_target).addToLog(errl); // HUID repeated for each addToLog() + ErrlUserDetailsTarget(c_target).addToLog(errl); ErrlUserDetailsAttribute(c_target,ATTR_EC).addToLog(errl); ErrlUserDetailsAttribute(c_target,ATTR_CHIP_ID).addToLog(errl); // 1 HUID only + ErrlUserDetailsTarget(c_target).addToLog(errl); ErrlUserDetailsAttribute(c_target,ATTR_HUID).addToLog(errl); // HUID only - not there @@ -234,7 +234,7 @@ public: // done - write it out pDimmEUDA.addToLog(errl); -#if 1 +#if 0 // extended test uint32_t i = 0; for (TargetIterator target = targetService().begin(); @@ -561,7 +561,7 @@ public: gardCount++; ErrlUserDetailsCallout( - HWAS::EPUB_PRC_MEMORY_UE, + HWAS::EPUB_PRC_FSI_PATH, HWAS::SRCI_PRIORITY_HIGH).addToLog(errl); // commit the errorlog diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C index 36f0b6229..bcd17879f 100644 --- a/src/usr/hwas/common/hwasCallout.C +++ b/src/usr/hwas/common/hwasCallout.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/hwas/common/hwasCallout.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * 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_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwas/common/hwasCallout.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,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 hwasCallout.C * @@ -78,7 +77,7 @@ void processCallout(const uint32_t i_errlPlid, pTarget = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; // TODO RTC: 45780 HWAS_INF("TARGET_SENTINEL - can't handle; exiting"); - break; // HWAS can't handle this right now... + break; // HWAS can't handle this right now... } else { diff --git a/src/usr/targeting/common/target.C b/src/usr/targeting/common/target.C index 6341d56bc..60134d156 100644 --- a/src/usr/targeting/common/target.C +++ b/src/usr/targeting/common/target.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -229,7 +229,7 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const AttributeTraits<ATTR_CLASS>::Type attrClass = getAttr<ATTR_CLASS>(); AttributeTraits<ATTR_TYPE>::Type attrType = getAttr<ATTR_TYPE>(); AttributeTraits<ATTR_MODEL>::Type attrModel = getAttr<ATTR_MODEL>(); - uint32_t headerSize = sizeof(uint8_t) + sizeof(attrHuid) + + uint32_t headerSize = sizeof(attrHuid) + sizeof(attrClass) + sizeof(attrType) + sizeof(attrModel); @@ -257,14 +257,12 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const pFFDC = static_cast<uint8_t*>( malloc( headerSize + pathPhysSize - + (pathPhysSize ? sizeof(attrEnum) : 0) + + sizeof(attrEnum) + pathAffSize - + (pathAffSize ? sizeof(attrEnum) : 0))); + + sizeof(attrEnum))); - // we'll send down a '0' then HUID CLASS TYPE and MODEL + // we'll send down HUID CLASS TYPE and MODEL uint32_t bSize = 0; // size of data in the buffer - *pFFDC = 0; - bSize++; memcpy(pFFDC + bSize, &attrHuid, sizeof(attrHuid) ); bSize += sizeof(attrHuid); memcpy(pFFDC + bSize, &attrClass, sizeof(attrClass) ); @@ -282,6 +280,13 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const memcpy(pFFDC + bSize, &pathPhys, pathPhysSize); bSize += pathPhysSize; } + else + { + // write 0x00 indicating no PHYS_PATH + attrEnum = 0x00; + memcpy(pFFDC + bSize, &attrEnum, sizeof(attrEnum)); + bSize += sizeof(attrEnum); + } if( pathAffSize > 0) { @@ -291,6 +296,13 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const memcpy(pFFDC + bSize, &pathAff, pathAffSize); bSize += pathAffSize; } + else + { + // write 0x00 indicating no AFFINITY_PATH + attrEnum = 0x00; + memcpy(pFFDC + bSize, &attrEnum, sizeof(attrEnum)); + bSize += sizeof(attrEnum); + } o_size = bSize; return pFFDC; diff --git a/src/usr/targeting/common/xmltohb/common.mk b/src/usr/targeting/common/xmltohb/common.mk index 5db0c2966..66514fdf5 100644 --- a/src/usr/targeting/common/xmltohb/common.mk +++ b/src/usr/targeting/common/xmltohb/common.mk @@ -29,19 +29,21 @@ # ################################################################################ -XMLTOHB_HEADER_TARGETS = \ - attributeenums.H \ - attributestrings.H \ - attributetraits.H \ - attributestructs.H \ - pnortargeting.H \ - fapiplatattrmacros.H \ - errludattribute.H +XMLTOHB_HEADER_TARGETS = \ + attributeenums.H \ + attributestrings.H \ + attributetraits.H \ + attributestructs.H \ + pnortargeting.H \ + fapiplatattrmacros.H \ + plugins/errludattribute.H \ + plugins/errludtarget.H XMLTOHB_SOURCE_TARGETS = \ attributestrings.C \ attributedump.C \ - errludattribute.C + errludattribute.C \ + errludtarget.C XMLTOHB_SYSTEM_BINARIES = \ vbu_targeting.bin \ diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index b6e6e0fad..6be3ddb3f 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -218,13 +218,27 @@ if( !($cfgSrcOutputDir =~ "none") ) writeAttrErrlCFile($attributes,$attrErrlCFile); close $attrErrlCFile; - open(ATTR_ATTRERRL_H_FILE,">$cfgSrcOutputDir"."errludattribute.H") + open(ATTR_ATTRERRL_H_FILE,">$cfgSrcOutputDir"."errl/errludattribute.H") or fatal ("Attribute errlog H file: \"$cfgSrcOutputDir" - . "errludattribute.H\" could not be opened."); + . "errl/errludattribute.H\" could not be opened."); my $attrErrlHFile = *ATTR_ATTRERRL_H_FILE; writeAttrErrlHFile($attributes,$attrErrlHFile); close $attrErrlHFile; + open(ATTR_TARGETERRL_C_FILE,">$cfgSrcOutputDir"."errludtarget.C") + or fatal ("Target errlog C file: \"$cfgSrcOutputDir" + . "errludtarget.C\" could not be opened."); + my $targetErrlCFile = *ATTR_TARGETERRL_C_FILE; + writeTargetErrlCFile($attributes,$targetErrlCFile); + close $targetErrlCFile; + + open(ATTR_TARGETERRL_H_FILE,">$cfgSrcOutputDir"."errl/errludtarget.H") + or fatal ("Target errlog H file: \"$cfgSrcOutputDir" + . "errl/errludtarget.H\" could not be opened."); + my $targetErrlHFile = *ATTR_TARGETERRL_H_FILE; + writeTargetErrlHFile($attributes,$targetErrlHFile); + close $targetErrlHFile; + } if( !($cfgImgOutputDir =~ "none") ) @@ -1506,7 +1520,7 @@ sub writeAttrErrlCFile { print $outFile "#include <stdint.h>\n"; print $outFile "#include <stdio.h>\n"; print $outFile "#include <string.h>\n"; - print $outFile "#include <errludattribute.H>\n"; + print $outFile "#include <errl/errludattribute.H>\n"; print $outFile "#include <errl/errlreasoncodes.H>\n"; print $outFile "#include <targeting/common/targetservice.H>\n"; print $outFile "#include <targeting/common/trace.H>\n"; @@ -1516,7 +1530,17 @@ sub writeAttrErrlCFile { print $outFile "using namespace TARGETING;\n"; print $outFile "extern TARG_TD_t g_trac_errl;\n"; - # loop through every attribute to create the local dump function + # build function that takes adds 1 attribute to the output + print $outFile "\n"; + print $outFile "void ErrlUserDetailsAttribute::addData(\n"; + print $outFile " uint32_t i_attr)\n"; + print $outFile "{\n"; + print $outFile " char *tmpBuffer = NULL;\n"; + print $outFile " uint32_t attrSize = 0;\n"; + print $outFile "\n"; + print $outFile " switch (i_attr) {\n"; + + # loop through every attribute to make the swith/case foreach my $attribute (@{$attributes->{attribute}}) { # things we'll skip: @@ -1524,40 +1548,32 @@ sub writeAttrErrlCFile { !(exists $attribute->{writeable}) || # read-only attributes (exists $attribute->{simpleType} && (exists $attribute->{simpleType}->{hbmutex})) # mutex attributes ) { + print $outFile " case (ATTR_",$attribute->{id},"): { break; }\n"; next; } # any complicated types just get dumped as raw hex binary elsif(exists $attribute->{complexType}) { - #print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - #print $outFile "{ //complexType\n"; - #print $outFile " uint32_t retSize = 0;\n"; - #print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; - #print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - #print $outFile " retSize = 1 + sprintf(i_buffer, \" \", &tmp, sizeof(tmp));\n"; - #print $outFile " }\n"; - #print $outFile " return(retSize);\n"; - #print $outFile "}\n"; - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //complexType\n"; - print $outFile " TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," skipped -- complexType\");\n"; - print $outFile " return(0);\n"; - print $outFile "}\n"; + print $outFile " case (ATTR_",$attribute->{id},"): {\n"; + print $outFile " TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," skipped -- complexType\");\n"; + print $outFile " attrSize = 0;\n"; + print $outFile " break;\n"; + print $outFile " }\n"; } # Enums elsif(exists $attribute->{simpleType} && (exists $attribute->{simpleType}->{enumeration}) ) { - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //simpleType:enum\n"; - print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; - print $outFile " uint32_t retSize = 0;\n"; - print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; - print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - print $outFile " memcpy(i_buffer, &tmp, sizeof(tmp));\n"; - print $outFile " retSize = sizeof(tmp);\n"; - print $outFile " }\n"; - print $outFile " return(retSize);\n"; - print $outFile "}\n"; + print $outFile " case (ATTR_",$attribute->{id},"): { // simpleType:enum\n"; + print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; + print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; + print $outFile " if( iv_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; + print $outFile " tmpBuffer = new char[sizeof(tmp)];\n"; + print $outFile " memcpy(tmpBuffer, &tmp, sizeof(tmp));\n"; + print $outFile " attrSize = sizeof(tmp);\n"; + print $outFile " }\n"; + print $outFile " break;\n"; + print $outFile " }\n"; } # signed and unsigned ints + elsif(exists $attribute->{simpleType} && ( (exists $attribute->{simpleType}->{uint8_t}) || (exists $attribute->{simpleType}->{uint16_t}) || @@ -1570,91 +1586,54 @@ sub writeAttrErrlCFile { ) ) { - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //simpleType:uint :int\n"; - print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; - print $outFile " uint32_t retSize = 0;\n"; - print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; - print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - print $outFile " memcpy(i_buffer, &tmp, sizeof(tmp));\n"; - print $outFile " retSize = sizeof(tmp);\n"; - print $outFile " }\n"; - print $outFile " return(retSize);\n"; - print $outFile "}\n"; + print $outFile " case (ATTR_",$attribute->{id},"): { //simpleType:uint, :int...\n"; + print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; + print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; + print $outFile " if( iv_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; + print $outFile " tmpBuffer = new char[sizeof(tmp)];\n"; + print $outFile " memcpy(tmpBuffer, &tmp, sizeof(tmp));\n"; + print $outFile " attrSize = sizeof(tmp);\n"; + print $outFile " }\n"; + print $outFile " break;\n"; + print $outFile " }\n"; } # dump the enums for EntityPaths elsif(exists $attribute->{nativeType} && ($attribute->{nativeType}->{name} eq "EntityPath")) { - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //nativeType:EntityPath\n"; - print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; - print $outFile " uint32_t retSize = 0;\n"; - print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; - print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - print $outFile " // data is PATH_TYPE, Number of elements, [ Element, Instance# ]\n"; - print $outFile " EntityPath::PATH_TYPE lPtype = tmp.type();\n"; - print $outFile " memcpy(i_buffer + retSize,&lPtype,sizeof(lPtype));\n"; - print $outFile " retSize += sizeof(lPtype);\n"; - print $outFile " uint8_t lSize = tmp.size();\n"; - print $outFile " memcpy(i_buffer + retSize,&lSize,sizeof(lSize));\n"; - print $outFile " retSize += sizeof(lSize);\n"; - print $outFile " for (uint32_t i=0;i<lSize;i++) {\n"; - print $outFile " EntityPath::PathElement lType = tmp[i];\n"; - print $outFile " memcpy(i_buffer + retSize,&tmp[i],sizeof(tmp[i]));\n"; - print $outFile " retSize += sizeof(tmp[i]);\n"; + print $outFile " case (ATTR_",$attribute->{id},"): { //nativeType:EntityPath\n"; + print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; + print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; + print $outFile " if( iv_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; + print $outFile " // data is PATH_TYPE, Number of elements, [ Element, Instance# ]\n"; + print $outFile " EntityPath::PATH_TYPE lPtype = tmp.type();\n"; + print $outFile " uint8_t lSize = tmp.size();\n"; + print $outFile " tmpBuffer = new char[sizeof(lPtype) + lSize + lSize * sizeof(EntityPath::PathElement)];\n"; + print $outFile " memcpy(tmpBuffer + attrSize,&lPtype,sizeof(lPtype));\n"; + print $outFile " attrSize += sizeof(lPtype);\n"; + print $outFile " memcpy(tmpBuffer + attrSize,&lSize,sizeof(lSize));\n"; + print $outFile " attrSize += sizeof(lSize);\n"; + print $outFile " for (uint32_t i=0;i<lSize;i++) {\n"; + print $outFile " EntityPath::PathElement lType = tmp[i];\n"; + print $outFile " memcpy(tmpBuffer + attrSize,&tmp[i],sizeof(tmp[i]));\n"; + print $outFile " attrSize += sizeof(tmp[i]);\n"; + print $outFile " }\n"; + print $outFile " }\n"; + print $outFile " break;\n"; print $outFile " }\n"; - print $outFile " }\n"; - print $outFile " return(retSize);\n"; print $outFile "}\n"; } # any other nativeTypes are just decimals... (I never saw one) elsif(exists $attribute->{nativeType}) { - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //nativeType\n"; - print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; - print $outFile " uint32_t retSize = 0;\n"; - print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; - print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - print $outFile " memcpy(i_buffer, &tmp, sizeof(tmp));\n"; - print $outFile " retSize = sizeof(tmp);\n"; - print $outFile " }\n"; - print $outFile " return(retSize);\n"; - print $outFile "}\n"; - } - # just in case, add a dummy function - else - { - print $outFile "uint32_t dump_ATTR_",$attribute->{id},"(const Target * i_pTarget, char *i_buffer)\n"; - print $outFile "{ //unknown attributes\n"; - print $outFile " TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," UNKNOWN\");\n"; - print $outFile " return(0);\n"; - print $outFile "}\n"; - } - } - - # build function that takes adds 1 attribute to the output - print $outFile "\n"; - print $outFile "void ErrlUserDetailsAttribute::addData(\n"; - print $outFile " uint32_t i_attr)\n"; - print $outFile "{\n"; - print $outFile " char *tmpBuffer = new char[1024];\n"; - print $outFile " uint32_t attrSize = 0;\n"; - print $outFile "\n"; - print $outFile " switch (i_attr) {\n"; - - # loop through every attribute to make the swith/case - foreach my $attribute (@{$attributes->{attribute}}) - { - # things we'll skip: - if(!(exists $attribute->{readable}) || # write-only attributes - !(exists $attribute->{writeable}) || # read-only attributes - (exists $attribute->{simpleType} && (exists $attribute->{simpleType}->{hbmutex})) # mutex attributes - ) { - print $outFile " case (ATTR_",$attribute->{id},"): { break; }\n"; - next; + print $outFile " case (ATTR_",$attribute->{id},"): { nativeType\n"; + print $outFile " //TRACDCOMP( g_trac_errl, \"ErrlUserDetailsAttribute: ",$attribute->{id}," entry\");\n"; + print $outFile " AttributeTraits<ATTR_",$attribute->{id},">::Type tmp;\n"; + print $outFile " if( iv_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; + print $outFile " tmpBuffer = new char[sizeof(tmp)];\n"; + print $outFile " memcpy(tmpBuffer, &tmp, sizeof(tmp));\n"; + print $outFile " attrSize = sizeof(tmp);\n"; + print $outFile " }\n"; + print $outFile " break;\n"; + print $outFile " }\n"; } - print $outFile " case (ATTR_",$attribute->{id},"): {\n"; - print $outFile " attrSize = dump_ATTR_",$attribute->{id},"(iv_pTarget,tmpBuffer); break;\n"; - print $outFile " }\n"; } print $outFile " default: { //Shouldn't be anything here!!\n"; @@ -1688,6 +1667,7 @@ sub writeAttrErrlCFile { print $outFile " iv_CompId = ERRL_COMP_ID;\n"; print $outFile " iv_Version = 1;\n"; print $outFile " iv_SubSection = ERRL_UDT_ATTRIBUTE;\n"; + print $outFile " // override the default of false\n"; print $outFile " iv_merge = true;\n"; print $outFile "\n"; print $outFile " // first, write out the HUID\n"; @@ -1802,25 +1782,28 @@ sub writeAttrErrlHFile { print $outFile " ErrlUserDetailsParserAttribute() {}\n"; print $outFile "\n"; print $outFile " virtual ~ErrlUserDetailsParserAttribute() {}\n"; - print $outFile "/**\n"; - print $outFile " * \@brief Parses Attribute user detail data from an error log\n"; - print $outFile " * \@param i_version Version of the data\n"; - print $outFile " * \@param i_parse ErrlUsrParser object for outputting information\n"; - print $outFile " * \@param i_pBuffer Pointer to buffer containing detail data\n"; - print $outFile " * \@param i_buflen Length of the buffer\n"; - print $outFile " */\n"; + print $outFile " /**\n"; + print $outFile " * \@brief Parses Attribute user detail data from an error log\n"; + print $outFile " * \@param i_version Version of the data\n"; + print $outFile " * \@param i_parse ErrlUsrParser object for outputting information\n"; + print $outFile " * \@param i_pBuffer Pointer to buffer containing detail data\n"; + print $outFile " * \@param i_buflen Length of the buffer\n"; + print $outFile " */\n"; print $outFile " virtual void parse(errlver_t i_version,\n"; print $outFile " ErrlUsrParser & i_parser,\n"; print $outFile " void * i_pBuffer,\n"; print $outFile " const uint32_t i_buflen) const\n"; print $outFile " {\n"; - print $outFile " const char *pLabel;\n"; + print $outFile " const char *pLabel = NULL;\n"; print $outFile " uint8_t *l_ptr = static_cast<uint8_t *>(i_pBuffer);\n"; - print $outFile " std::vector<char> l_traceEntry(128);\n"; + print $outFile " std::vector<char> l_traceEntry(64);\n"; + print $outFile " i_parser.PrintString(\"Target Attributes\", NULL);\n"; print $outFile "\n"; + + print $outFile " for (; (l_ptr + sizeof(uint32_t)) <= ((uint8_t*)i_pBuffer + i_buflen); )\n"; + print $outFile " {\n"; print $outFile " // first 4 bytes is the attr enum\n"; - print $outFile " uint32_t attrEnum = *(uint32_t *)l_ptr;\n"; - print $outFile " uint32_t dataSize = 0;\n"; + print $outFile " uint32_t attrEnum = ntohl(*(uint32_t *)l_ptr);\n"; print $outFile " l_ptr += sizeof(attrEnum);\n"; print $outFile "\n"; print $outFile " switch (attrEnum) {\n"; @@ -1841,7 +1824,7 @@ sub writeAttrErrlHFile { # Enums have strings defined already, use them elsif(exists $attribute->{simpleType} && (exists $attribute->{simpleType}->{enumeration}) ) { print $outFile " //simpleType:enum\n"; - print $outFile " pLabel = \"ATTR_",$attribute->{id},"\";\n"; + print $outFile " pLabel = \"",$attribute->{id},"\";\n"; foreach my $enumerationType (@{$attributes->{enumerationType}}) { if ($enumerationType->{id} eq $attribute->{id}) @@ -1852,8 +1835,8 @@ sub writeAttrErrlHFile { my $enumName = $attribute->{id} . "_" . $enumerator->{name}; my $enumHex = sprintf "0x%08X", enumNameToValue($enumerationType,$enumerator->{name}); print $outFile " case ",$enumHex,": {\n"; - print $outFile " // get the length and add one for the null terminator "; - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"",$enumName,"\");\n"; + print $outFile " sprintf(&(l_traceEntry[0]), \"",$enumName,"\");\n"; + print $outFile " l_ptr += sizeof(uint32_t);\n"; print $outFile " break;\n"; print $outFile " }\n"; } @@ -1871,7 +1854,7 @@ sub writeAttrErrlHFile { #print $outFile " //complexType\n"; #print $outFile " uint32_t<ATTR_",$attribute->{id},">::Type tmp;\n"; #print $outFile " if( i_pTarget->tryGetAttr<ATTR_",$attribute->{id},">(tmp) ) {\n"; - #print $outFile " dataSize = sprintf(i_buffer, \" \", &tmp, sizeof(tmp));\n"; + #print $outFile " sprintf(i_buffer, \" \", &tmp, sizeof(tmp));\n"; #print $outFile " }\n"; print $outFile " //complexType - skipping\n"; } @@ -1889,41 +1872,100 @@ sub writeAttrErrlHFile { ) { print $outFile " //simpleType:uint\n"; - print $outFile " pLabel = \"ATTR_",$attribute->{id},"\";\n"; + print $outFile " pLabel = \"",$attribute->{id},"\";\n"; + my @bounds; + if(exists $attribute->{simpleType}->{array}) + { + @bounds = split(/,/,$attribute->{simpleType}->{array}); + } + else + { + $bounds[0] = 1; + } + my $total_count = 1; + foreach my $bound (@bounds) + { + $total_count *= $bound; + } + my $size = scalar(@bounds); + if (($size == 1) && ( $bounds[0] > 1)) + { + print $outFile " uint32_t offset = sprintf(&(l_traceEntry[0]), \"[$bounds[0]]:\");\n"; + } + elsif ($size == 2) + { + print $outFile " uint32_t offset = sprintf(&(l_traceEntry[0]), \"[$bounds[0]][$bounds[1]]:\");\n"; + } + elsif ($size == 3) + { + print $outFile " uint32_t offset = sprintf(&(l_traceEntry[0]), \"[$bounds[0]][$bounds[1]][$bounds[2]]:\");\n"; + } + else + { + print $outFile " uint32_t offset = 0;\n"; + } if (exists $attribute->{simpleType}->{uint8_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"0x%.2X\", *((uint8_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 5);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*5]), \"0x%.2X \", *((uint8_t *)l_ptr)+i);\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(uint8_t);\n"; } elsif (exists $attribute->{simpleType}->{uint16_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"0x%.4X\", *((uint16_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 7);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*7]), \"0x%.4X \", ntohs(*((uint16_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(uint16_t);\n"; } elsif (exists $attribute->{simpleType}->{uint32_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"0x%.8X\", *((uint32_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 11);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*11]), \"0x%.8X \", ntohl(*((uint32_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(uint32_t);\n"; } elsif (exists $attribute->{simpleType}->{uint64_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"0x%.16llX\", *((uint64_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 19);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*19]), \"0x%.16llX \", ntohll(*((uint64_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(uint64_t);\n"; } elsif (exists $attribute->{simpleType}->{int8_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"%d\", *((int8_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 5);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*5]), \"0x%.2X \", *((uint8_t *)l_ptr)+i);\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(uint8_t);\n"; } elsif (exists $attribute->{simpleType}->{int16_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"%d\", *((int16_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 7);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*7]), \"0x%.4X \", ntohs(*((int16_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(int16_t);\n"; } elsif (exists $attribute->{simpleType}->{int32_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"%d\", *((int32_t *)l_ptr));\n"; + print $outFile " l_traceEntry.resize(10+offset + $total_count * 11);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*11]), \"0x%.8X \", ntohl(*((int32_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(int32_t);\n"; } elsif (exists $attribute->{simpleType}->{int64_t}) { - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"%d\", *((int64_t *)l_ptr));\n"; - } - if(exists $attribute->{array}) - { - ### need to do loop for types that are ARRAYS! + print $outFile " l_traceEntry.resize(10+offset + $total_count * 19);\n"; + print $outFile " for (uint32_t i = 0;i<$total_count;i++) {\n"; + print $outFile " sprintf(&(l_traceEntry[offset+i*19]), \"0x%.16llX \", ntohll(*((int64_t *)l_ptr)+i));\n"; + print $outFile " }\n"; + print $outFile " l_ptr += $total_count * sizeof(int64_t);\n"; } } # EntityPaths elsif(exists $attribute->{nativeType} && ($attribute->{nativeType}->{name} eq "EntityPath")) { print $outFile " //nativeType:EntityPath\n"; - print $outFile " pLabel = \"ATTR_",$attribute->{id},"\";\n"; + print $outFile " pLabel = \"",$attribute->{id},"\";\n"; # data is PATH_TYPE, Number of elements, [ Element, Instance# ] # output is PathType:/ElementInstance/ElementInstance/ElementInstance print $outFile " const char *pathString;\n"; @@ -1936,48 +1978,48 @@ sub writeAttrErrlHFile { print $outFile " case 0x04: pathString = \"Power:\"; break;\n"; print $outFile " default: pathString = \"Unknown:\"; break;\n"; print $outFile " }\n"; - print $outFile " dataSize = sprintf(&(l_traceEntry[0]), \"%s\",pathString);\n"; + print $outFile " l_traceEntry.resize(strlen(pathString) + 128);\n"; + print $outFile " uint32_t dataSize = sprintf(&(l_traceEntry[0]), \"%s\",pathString);\n"; print $outFile " const uint8_t lSize = *(l_ptr + 1); // number of elements\n"; print $outFile " uint8_t *lElementInstance = (l_ptr + 2);\n"; print $outFile " for (uint32_t i=0;i<lSize;i += 2) {\n"; print $outFile " switch (lElementInstance[i]) {\n"; - - # TODO: RTC 50828: make these build-time dynamic based - # on values in obj/genfiles/attributeenums.H - print $outFile " case 0x01: pathString = \"/Sys\"; break;\n"; - print $outFile " case 0x02: pathString = \"/Node\"; break;\n"; - print $outFile " case 0x03: pathString = \"/DIMM\"; break;\n"; - print $outFile " case 0x04: pathString = \"/Membuf\"; break;\n"; - print $outFile " case 0x05: pathString = \"/Proc\"; break;\n"; - print $outFile " case 0x06: pathString = \"/EX\"; break;\n"; - print $outFile " case 0x07: pathString = \"/Core\"; break;\n"; - print $outFile " case 0x08: pathString = \"/L2\"; break;\n"; - print $outFile " case 0x09: pathString = \"/L3\"; break;\n"; - print $outFile " case 0x0A: pathString = \"/L4\"; break;\n"; - print $outFile " case 0x0B: pathString = \"/MCS\"; break;\n"; - print $outFile " case 0x0C: pathString = \"/MBS\"; break;\n"; - print $outFile " case 0x0D: pathString = \"/MBA\"; break;\n"; - print $outFile " case 0x0E: pathString = \"/XBUS\"; break;\n"; - print $outFile " case 0x0F: pathString = \"/ABUS\"; break;\n"; - print $outFile " case 0x10: pathString = \"/PCI\"; break;\n"; - print $outFile " case 0x11: pathString = \"/DPSS\"; break;\n"; - print $outFile " case 0x12: pathString = \"/APSS\"; break;\n"; - print $outFile " case 0x13: pathString = \"/OCC\"; break;\n"; - print $outFile " case 0x14: pathString = \"/PSI\"; break;\n"; - print $outFile " case 0x15: pathString = \"/FSP\"; break;\n"; - print $outFile " case 0x16: pathString = \"/PNOR\"; break;\n"; - print $outFile " default: pathString = \"/Unknown\"; break;\n"; + foreach my $enumerationType (@{$attributes->{enumerationType}}) + { + if( $enumerationType->{id} eq "TYPE" ) { + foreach my $enumerator (@{$enumerationType->{enumerator}}) + { + my $enumHex = sprintf "0x%02X", + enumNameToValue($enumerationType,$enumerator->{name}); + my $enumName = $enumerator->{name}; + if ($enumName eq "SYS") { + $enumName = "Sys"; + } elsif ($enumName eq "PROC") { + $enumName = "Proc"; + } elsif ($enumName eq "NODE") { + $enumName = "Node"; + } elsif ($enumName eq "CORE") { + $enumName = "Core"; + } elsif ($enumName eq "MEMBUF") { + $enumName = "Membuf"; + } + print $outFile " case $enumHex: { pathString = \"/$enumName\"; break; }\n"; + } + } + } # enumerationType + print $outFile " default: { pathString = \"/UNKNOWN\"; break; }\n"; print $outFile " } // switch\n"; print $outFile " // copy next part in, overwritting previous terminator\n"; print $outFile " dataSize += sprintf(&(l_traceEntry[0]) + dataSize, \"%s%d\",pathString,lElementInstance[i+1]);\n"; + print $outFile " l_ptr += 2 * sizeof(uint8_t);\n"; print $outFile " } // for\n"; - print $outFile " dataSize++; // account for last NULL terminator\n"; } # any other nativeTypes are just decimals... (I never saw one) elsif(exists $attribute->{nativeType}) { print $outFile " //nativeType\n"; - print $outFile " pLabel = \"ATTR_",$attribute->{id},"\";\n"; - print $outFile " dataSize = 1 + sprintf(&(l_traceEntry[0]), \"%d\", *((int32_t *)l_ptr));\n"; + print $outFile " pLabel = \"",$attribute->{id},"\";\n"; + print $outFile " sprintf(&(l_traceEntry[0]), \"%d\", *((int32_t *)l_ptr));\n"; + print $outFile " l_ptr += sizeof(uint32_t);\n"; } # just in case, nothing.. else @@ -1996,14 +2038,11 @@ sub writeAttrErrlHFile { print $outFile " } // switch\n"; print $outFile "\n"; print $outFile " // pointing to something - print it.\n"; - print $outFile " if (dataSize != 0) {\n"; - print $outFile " if (l_traceEntry.size() < dataSize + 2) {\n"; - print $outFile " l_traceEntry.resize(dataSize + 2);\n"; - print $outFile " }\n"; + print $outFile " if (pLabel != NULL) {\n"; print $outFile " i_parser.PrintString(pLabel, &(l_traceEntry[0]));\n"; print $outFile " }\n"; - print $outFile " l_ptr += dataSize;\n"; - print $outFile " } // for\n\n"; + print $outFile " } // for\n"; + print $outFile " } // parse\n\n"; print $outFile "private:\n"; print $outFile "\n"; print $outFile "// Disabled\n"; @@ -2015,6 +2054,293 @@ sub writeAttrErrlHFile { print $outFile "#endif\n"; } # sub writeAttrErrlHFile +###### +#Create a .C file to put target into the errlog +##### +sub writeTargetErrlCFile { + my($attributes,$outFile) = @_; + + #First setup the includes and function definition + print $outFile "#include <stdint.h>\n"; + print $outFile "#include <stdio.h>\n"; + print $outFile "#include <string.h>\n"; + print $outFile "#include <errl/errludtarget.H>\n"; + print $outFile "#include <errl/errlreasoncodes.H>\n"; + print $outFile "#include <targeting/common/target.H>\n"; + print $outFile "#include <targeting/common/targetservice.H>\n"; + print $outFile "#include <targeting/common/trace.H>\n"; + print $outFile "\n"; + print $outFile "namespace ERRORLOG\n"; + print $outFile "{\n"; + print $outFile "using namespace TARGETING;\n"; + print $outFile "extern TARG_TD_t g_trac_errl;\n"; + + print $outFile "//------------------------------------------------------------------------------\n"; + print $outFile "ErrlUserDetailsTarget::ErrlUserDetailsTarget(\n"; + print $outFile " const Target * i_pTarget)\n"; + print $outFile "{\n"; + print $outFile " // Set up ErrlUserDetails instance variables\n"; + print $outFile " iv_CompId = ERRL_COMP_ID;\n"; + print $outFile " iv_Version = 1;\n"; + print $outFile " iv_SubSection = ERRL_UDT_TARGET;\n"; + print $outFile " // override the default of false\n"; + print $outFile " iv_merge = true;\n"; + print $outFile "\n"; + print $outFile " if (i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) {\n"; + print $outFile " uint32_t *pBuffer = reinterpret_cast<uint32_t *>(\n"; + print $outFile " reallocUsrBuf(sizeof(uint32_t)));\n"; + print $outFile " // copy 0xFFFFFFFF to indicate MASTER just as gethuid() does\n"; + print $outFile " *pBuffer = 0xFFFFFFFF;\n"; + print $outFile " } else {\n"; + print $outFile " uint32_t bufSize = 0;\n"; + print $outFile " uint8_t *pTargetString = i_pTarget->targetFFDC(bufSize);\n"; + print $outFile " uint8_t *pBuffer = reinterpret_cast<uint8_t *>(reallocUsrBuf(bufSize));\n"; + print $outFile " memcpy(pBuffer, pTargetString, bufSize);\n"; + print $outFile " free (pTargetString);\n"; + print $outFile " }\n"; + print $outFile "}\n"; + print $outFile "\n"; + + print $outFile "\n"; + + print $outFile "//------------------------------------------------------------------------------\n"; + print $outFile "ErrlUserDetailsTarget::~ErrlUserDetailsTarget()\n"; + print $outFile "{ }\n"; + print $outFile "} // namespace\n"; +} # sub writeTargetErrlCFile + + +###### +#Create a .H file to parse attributes out of the errlog +##### +sub writeTargetErrlHFile { + my($attributes,$outFile) = @_; + + #First setup the includes and function definition + print $outFile "\n"; + print $outFile "#ifndef ERRL_UDTARGET_H\n"; + print $outFile "#define ERRL_UDTARGET_H\n"; + print $outFile "\n"; + print $outFile "#ifndef PARSER\n"; + print $outFile "\n"; + print $outFile "#include <errl/errluserdetails.H>\n"; + print $outFile "\n"; + print $outFile "namespace TARGETING // Forward reference\n"; + print $outFile "{ class Target; }\n"; + print $outFile "\n"; + print $outFile "namespace ERRORLOG\n"; + print $outFile "{\n"; + print $outFile "class ErrlUserDetailsTarget : public ErrlUserDetails {\n"; + print $outFile "public:\n"; + print $outFile "\n"; + print $outFile " ErrlUserDetailsTarget(const TARGETING::Target * i_pTarget);\n"; + print $outFile " virtual ~ErrlUserDetailsTarget();\n"; + print $outFile "\n"; + print $outFile "private:\n"; + print $outFile "\n"; + print $outFile " // Disabled\n"; + print $outFile " ErrlUserDetailsTarget(const ErrlUserDetailsTarget &);\n"; + print $outFile " ErrlUserDetailsTarget & operator=(const ErrlUserDetailsTarget &);\n"; + print $outFile "};\n"; + print $outFile "}\n"; + print $outFile "#else // if PARSER defined\n"; + print $outFile "\n"; + print $outFile "#include \"errluserdetails.H\"\n"; + print $outFile "#include <string.h>\n"; + print $outFile "\n"; + print $outFile "namespace ERRORLOG\n"; + print $outFile "{\n"; + + # local function used by Target and Callout to print the entity path + + print $outFile " static uint8_t *errlud_parse_entity_path(uint8_t *i_ptr, char *o_ptr)\n"; + print $outFile " {\n"; + print $outFile " uint8_t *l_ptr = i_ptr;\n"; + + print $outFile " // from targeting/common/entitypath.[CH]\n"; + print $outFile " // entityPath is PATH_TYPE:4, NumberOfElements:4, \n"; + print $outFile " // [Element, Instance#]\n"; + print $outFile " // PATH_TYPE\n"; + print $outFile " const char *pathString;\n"; + print $outFile " const uint8_t pathTypeLength = *l_ptr;\n"; + print $outFile " l_ptr++;\n"; + print $outFile " const uint8_t pathType = (pathTypeLength & 0xF0) >> 4;\n"; + print $outFile " switch (pathType) {\n"; + print $outFile " case 0x01: pathString = \"Logical:\"; break;\n"; + print $outFile " case 0x02: pathString = \"Physical:\"; break;\n"; + print $outFile " case 0x03: pathString = \"Device:\"; break;\n"; + print $outFile " case 0x04: pathString = \"Power:\"; break;\n"; + print $outFile " default: pathString = \"Unknown:\"; break;\n"; + print $outFile " }\n"; + print $outFile " uint32_t dataSize = sprintf(o_ptr, \"%s\",pathString);\n"; + print $outFile " const uint8_t pathSize = (pathTypeLength & 0x0F) * 2;\n"; + print $outFile " uint8_t *lElementInstance = l_ptr;\n"; + print $outFile " l_ptr += pathSize * sizeof(uint8_t);\n"; + print $outFile " for (uint32_t j=0;j<pathSize;j += 2) {\n"; + print $outFile " switch (lElementInstance[j]) {\n"; + foreach my $enumerationType (@{$attributes->{enumerationType}}) + { + if( $enumerationType->{id} eq "TYPE" ) { + foreach my $enumerator (@{$enumerationType->{enumerator}}) + { + my $enumHex = sprintf "0x%02X", + enumNameToValue($enumerationType,$enumerator->{name}); + #my $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; + my $enumName = $enumerator->{name}; + if ($enumName eq "SYS") { + $enumName = "Sys"; + } elsif ($enumName eq "PROC") { + $enumName = "Proc"; + } elsif ($enumName eq "NODE") { + $enumName = "Node"; + } elsif ($enumName eq "CORE") { + $enumName = "Core"; + } elsif ($enumName eq "MEMBUF") { + $enumName = "Membuf"; + } + print $outFile " case $enumHex: { pathString = \"/$enumName\"; break; }\n"; + } + } + } # enumerationType + print $outFile " default: { pathString = \"/UKNOWN\"; break; }\n"; + + print $outFile " } // switch\n"; + print $outFile " // copy next part in, overwritting previous terminator\n"; + print $outFile " dataSize += sprintf(o_ptr + dataSize,\n"; + print $outFile " \"%s%d\", pathString,\n"; + print $outFile " lElementInstance[j+1]);\n"; + print $outFile " } // for\n"; + print $outFile " return l_ptr;\n"; + print $outFile "} // errlud_parse_entity_path \n"; + + print $outFile "class ErrlUserDetailsParserTarget : public ErrlUserDetailsParser {\n"; + print $outFile "public:\n"; + print $outFile "\n"; + print $outFile " ErrlUserDetailsParserTarget() {}\n"; + print $outFile "\n"; + print $outFile " virtual ~ErrlUserDetailsParserTarget() {}\n"; + print $outFile "/**\n"; + print $outFile " * \@brief Parses Target user detail data from an error log\n"; + print $outFile " * \@param i_version Version of the data\n"; + print $outFile " * \@param i_parse ErrlUsrParser object for outputting information\n"; + print $outFile " * \@param i_pBuffer Pointer to buffer containing detail data\n"; + print $outFile " * \@param i_buflen Length of the buffer\n"; + print $outFile " */\n"; + print $outFile " virtual void parse(errlver_t i_version,\n"; + print $outFile " ErrlUsrParser & i_parser,\n"; + print $outFile " void * i_pBuffer,\n"; + print $outFile " const uint32_t i_buflen) const\n"; + print $outFile " {\n"; + print $outFile " const char *attrData;\n"; + print $outFile " uint32_t *l_ptr32 = reinterpret_cast<uint32_t *>(i_pBuffer);\n"; + print $outFile " // while there is still at least 1 word of data left\n"; + print $outFile " for (; (l_ptr32 + 1) <= (uint32_t *)((uint8_t*)i_pBuffer + i_buflen); )\n"; + print $outFile " {\n"; + print $outFile " if (*l_ptr32 == 0xFFFFFFFF) { // special - master\n"; + print $outFile " i_parser.PrintString(\"Target\", \"MASTER_PROCESSOR_CHIP_TARGET_SENTINEL\");\n"; + print $outFile " l_ptr32++; // past the marker\n"; + print $outFile " } else { \n"; + + print $outFile " // first 4 are always the same\n"; + print $outFile " if ((l_ptr32 + 4) <= (uint32_t *)((uint8_t*)i_pBuffer + i_buflen)) {\n"; + print $outFile " i_parser.PrintNumber( \"Target\", \"HUID = 0x%08X\", ntohl(*l_ptr32) );\n"; + print $outFile " l_ptr32++;\n"; + + # find CLASS + print $outFile " switch (ntohl(*l_ptr32)) { // CLASS\n"; + foreach my $enumerationType (@{$attributes->{enumerationType}}) + { + if( $enumerationType->{id} eq "CLASS" ) { + foreach my $enumerator (@{$enumerationType->{enumerator}}) + { + my $enumHex = sprintf "0x%02X", + enumNameToValue($enumerationType,$enumerator->{name}); + my $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; + print $outFile " case $enumHex: { attrData = \"$enumName\"; break; }\n"; + } + } + } # enumerationType + print $outFile " default: { attrData = \"UNKNOWN_CLASS\"; break; }\n"; + print $outFile " } // switch\n"; + print $outFile " i_parser.PrintString(\" ATTR_CLASS\", attrData);\n"; + print $outFile " l_ptr32++;\n"; + + # find TYPE + print $outFile " switch (ntohl(*l_ptr32)) { // TYPE\n"; + foreach my $enumerationType (@{$attributes->{enumerationType}}) + { + if( $enumerationType->{id} eq "TYPE" ) { + foreach my $enumerator (@{$enumerationType->{enumerator}}) + { + my $enumHex = sprintf "0x%02X", + enumNameToValue($enumerationType,$enumerator->{name}); + my $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; + print $outFile " case $enumHex: { attrData = \"$enumName\"; break; }\n"; + } + } + } # enumerationType + print $outFile " default: { attrData = \"UNKNOWN_TYPE\"; break; }\n"; + print $outFile " } // switch\n"; + print $outFile " i_parser.PrintString(\" ATTR_TYPE\", attrData);\n"; + print $outFile " l_ptr32++;\n"; + + # find MODEL + print $outFile " switch (ntohl(*l_ptr32)) { // MODEL\n"; + foreach my $enumerationType (@{$attributes->{enumerationType}}) + { + if( $enumerationType->{id} eq "MODEL" ) { + foreach my $enumerator (@{$enumerationType->{enumerator}}) + { + my $enumHex = sprintf "0x%02X", + enumNameToValue($enumerationType,$enumerator->{name}); + my $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; + print $outFile " case $enumHex: { attrData = \"$enumName\"; break; }\n"; + } + } + } # enumerationType + print $outFile " default: { attrData = \"UNKNOWN_MODEL\"; break; }\n"; + print $outFile " } // switch\n"; + print $outFile " i_parser.PrintString(\" ATTR_MODEL\", attrData);\n"; + print $outFile " l_ptr32++;\n"; + print $outFile " // 2 Entity Paths next\n"; + print $outFile " for (uint32_t k = 0;k < 2; k++)\n"; + print $outFile " {\n"; + print $outFile " uint32_t l_pathType = ntohl(*l_ptr32);\n"; + print $outFile " if ((l_pathType == 0x15) || // ATTR_PHYS_PATH\n"; + print $outFile " (l_pathType == 0x16)) // ATTR_AFFINITY_PATH\n"; + print $outFile " {\n"; + print $outFile " l_ptr32++;\n"; + print $outFile " uint8_t *l_ptr = reinterpret_cast<uint8_t *>(l_ptr32);\n"; + print $outFile " char outString[128];\n"; + print $outFile " l_ptr = errlud_parse_entity_path(l_ptr,outString);\n"; + print $outFile " if (l_pathType == 0x15)\n"; + print $outFile " {\n"; + print $outFile " i_parser.PrintString(\" ATTR_PHYS_PATH\", outString);\n"; + print $outFile " }\n"; + print $outFile " if (l_pathType == 0x16)\n"; + print $outFile " {\n"; + print $outFile " i_parser.PrintString(\" ATTR_AFFINITY_PATH\", outString);\n"; + print $outFile " } // else don't print anything\n"; + print $outFile " l_ptr32 = reinterpret_cast<uint32_t *>(l_ptr);\n"; + print $outFile " } else {\n"; + print $outFile " l_ptr32++;\n"; + print $outFile " }\n"; + print $outFile " } // for\n"; + print $outFile " } // if\n"; + print $outFile " }\n"; + print $outFile " } // for\n"; + print $outFile " } // parse()\n\n"; + print $outFile "private:\n"; + print $outFile "\n"; + print $outFile "// Disabled\n"; + print $outFile "ErrlUserDetailsParserTarget(const ErrlUserDetailsParserTarget &);\n"; + print $outFile "ErrlUserDetailsParserTarget & operator=(const ErrlUserDetailsParserTarget &);\n"; + print $outFile "};\n"; + print $outFile "} // namespace\n"; + print $outFile "#endif\n"; + print $outFile "#endif\n"; +} # sub writeTargetErrlHFile + #fixme-Remove when RTC:38197 is done diff --git a/src/usr/targeting/xmltohb/makefile b/src/usr/targeting/xmltohb/makefile index 1ec27aab2..000aabd8a 100644 --- a/src/usr/targeting/xmltohb/makefile +++ b/src/usr/targeting/xmltohb/makefile @@ -96,7 +96,15 @@ CLEAN_TARGETS += $(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES}) \ $(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES:.bin=.xml}) \ ${GENDIR}/${XMLTOHB_GENERIC_XML} ${GENDIR}/${XMLTOHB_FAPI_XML} \ ${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} \ - ${GENDIR_PLUGINS}/errludattribute.H + ${GENDIR}/errl/errludattribute.H \ + ${GENDIR}/errl/errludtarget.H + +GENDIR_ERRL = $(ROOTPATH)/obj/genfiles/errl + +.PHONY: make_gendir_errl +make_gendir_errl: + @mkdir -p $(GENDIR_ERRL) +GEN_PASS_PRE += make_gendir_errl include ${ROOTPATH}/config.mk @@ -131,7 +139,8 @@ call_xmltohb_compiler: ${XMLTOHB_COMPILER_SCRIPT} \ $(addprefix --fapi-attributes-xml-file=,${GENDIR}/${XMLTOHB_FAPI_XML}) \ --src-output-dir=$(GENDIR) --img-output-dir=none \ --img-output-file=none - cp ${GENDIR}/errludattribute.H ${GENDIR_PLUGINS} + cp ${GENDIR_ERRL}/errludattribute.H ${GENDIR_PLUGINS} + cp ${GENDIR_ERRL}/errludtarget.H ${GENDIR_PLUGINS} # system-specific XML needs the generic plus the xxx.system.xml file + the # MRW file |