diff options
Diffstat (limited to 'src/usr/errl/plugins')
-rw-r--r-- | src/usr/errl/plugins/errludattributeP.H | 41 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludbacktrace.H | 7 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludcallout.H | 1 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludlogregister.H | 14 | ||||
-rwxr-xr-x | src/usr/errl/plugins/errludparser.H | 4 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludparserfactoryerrl.H | 4 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludwofdata.H | 5 | ||||
-rwxr-xr-x | src/usr/errl/plugins/errluserdetails.H | 91 |
8 files changed, 152 insertions, 15 deletions
diff --git a/src/usr/errl/plugins/errludattributeP.H b/src/usr/errl/plugins/errludattributeP.H new file mode 100644 index 000000000..d097ad9e7 --- /dev/null +++ b/src/usr/errl/plugins/errludattributeP.H @@ -0,0 +1,41 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/errl/plugins/errludattributeP.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef ERRL_UDATTRIBUTEP_H +#define ERRL_UDATTRIBUTEP_H + +/** + * Defines the classes that allow you to parse attribute data + * that was previously saved to an error log with + * ERRORLOG::ErrlUserDetailsAttribute. + */ + +#include "errluserdetails.H" + +// Pull in the auto-generated portion for the parser +// Created by xmltohb.pl +#include <errludattributeP_gen.H> + + +#endif // ERRL_UDATTRIBUTEP_H diff --git a/src/usr/errl/plugins/errludbacktrace.H b/src/usr/errl/plugins/errludbacktrace.H index 898ea8faa..9ecc11511 100644 --- a/src/usr/errl/plugins/errludbacktrace.H +++ b/src/usr/errl/plugins/errludbacktrace.H @@ -5,7 +5,10 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* [+] International Business Machines Corp. */ +/* [+] YADRO */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -113,7 +116,7 @@ public: for( int i = 0; i < l_count; i++ ) { // endian convert the stack address - uint64_t l_addr = ntohll(*p64); + uint64_t l_addr = ntohll(UINT64_FROM_PTR(p64)); // get nearest symbol const char * l_pSymbol = symTab.nearestSymbol( l_addr ); diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H index fc45e5590..47cbfd9fd 100644 --- a/src/usr/errl/plugins/errludcallout.H +++ b/src/usr/errl/plugins/errludcallout.H @@ -210,6 +210,7 @@ case HWAS::_type: i_parser.PrintString( "Bus Type", #_type); break; case_BUS_TYPE(I2C_BUS_TYPE) case_BUS_TYPE(PSI_BUS_TYPE) case_BUS_TYPE(O_BUS_TYPE) + case_BUS_TYPE(OMI_BUS_TYPE) default: i_parser.PrintNumber( "Bus Type", "UNKNOWN: 0x%X", ntohl(pData->busType) ); diff --git a/src/usr/errl/plugins/errludlogregister.H b/src/usr/errl/plugins/errludlogregister.H index f795a9643..221458022 100644 --- a/src/usr/errl/plugins/errludlogregister.H +++ b/src/usr/errl/plugins/errludlogregister.H @@ -5,9 +5,10 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ +/* [+] YADRO */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -79,7 +80,7 @@ public: { // first is the HUID uint32_t *pData = reinterpret_cast<uint32_t *>(pBuf); - if (ntohl(*pData) == 0xFFFFFFFF) + if (ntohl(UINT32_FROM_PTR(pData)) == 0xFFFFFFFF) { i_parser.PrintString("LogRegister", "Target: MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); @@ -87,7 +88,7 @@ public: else { i_parser.PrintNumber( "LogRegister", - "Target: HUID = 0x%08X", ntohl(*pData) ); + "Target: HUID = 0x%08X", ntohl(UINT32_FROM_PTR(pData)) ); } pData++; pBuf += sizeof(*pData); @@ -122,6 +123,11 @@ public: numArgs = 1; addrParams.push_back(" SPD keyword enumaration"); break; + case DeviceFW::NVDIMM: // userif.H + i_parser.PrintString("AccessType", "DeviceFW::NVDIMM"); + numArgs = 1; + addrParams.push_back(" NVDIMM address"); + break; case DeviceFW::XSCOM: // driverif.H i_parser.PrintString("AccessType", "DeviceFW::XSCOM"); numArgs = 1; @@ -199,7 +205,7 @@ public: for (int32_t i = 0;i < numArgs;i++) { std::vector<char> l_traceEntry(20); - sprintf(&(l_traceEntry[0]),"0x%016llX", ntohll(*pData64)); + sprintf(&(l_traceEntry[0]),"0x%016llX", ntohll(UINT64_FROM_PTR(pData64))); i_parser.PrintString(addrParams[i], &(l_traceEntry[0])); pData64++; diff --git a/src/usr/errl/plugins/errludparser.H b/src/usr/errl/plugins/errludparser.H index ddaadade7..6957d4632 100755 --- a/src/usr/errl/plugins/errludparser.H +++ b/src/usr/errl/plugins/errludparser.H @@ -5,8 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ +/* [+] YADRO */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -84,6 +85,7 @@ static bool myDataParse(\ {\ l_rc = true;\ l_pParser->parse(i_ver, i_parser, i_buffer, i_buflen);\ + delete l_pParser;\ }\ return l_rc;\ }\ diff --git a/src/usr/errl/plugins/errludparserfactoryerrl.H b/src/usr/errl/plugins/errludparserfactoryerrl.H index fbefe231f..d5999c807 100644 --- a/src/usr/errl/plugins/errludparserfactoryerrl.H +++ b/src/usr/errl/plugins/errludparserfactoryerrl.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,7 +34,7 @@ #include "errludstring.H" #include "errludtarget.H" #include "errludbacktrace.H" -#include "errludattribute.H" +#include "errludattributeP.H" #include "errludlogregister.H" #include "errludcallout.H" #include "errludsensor.H" diff --git a/src/usr/errl/plugins/errludwofdata.H b/src/usr/errl/plugins/errludwofdata.H index f792c5485..203a4a14e 100644 --- a/src/usr/errl/plugins/errludwofdata.H +++ b/src/usr/errl/plugins/errludwofdata.H @@ -5,8 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* Contributors Listed Below - COPYRIGHT 2017,2019 */ /* [+] International Business Machines Corp. */ +/* [+] YADRO */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -98,7 +99,7 @@ public: // addWofCompareDataToErrl() in plat_wof_access.C if ((NULL != i_pBuffer) && (i_buflen >= sizeof(tableEntries))) { - tableEntries = ntohs(*(reinterpret_cast<uint16_t*>(i_pBuffer))); + tableEntries = ntohs(UINT16_FROM_PTR(i_pBuffer)); } // How many entries are really present in this buffer? diff --git a/src/usr/errl/plugins/errluserdetails.H b/src/usr/errl/plugins/errluserdetails.H index 917dcf266..eac453505 100755 --- a/src/usr/errl/plugins/errluserdetails.H +++ b/src/usr/errl/plugins/errluserdetails.H @@ -5,8 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ +/* [+] YADRO */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -39,6 +40,88 @@ namespace ERRORLOG { /** + * @struct UnalignedData + * @brief Structure used for safe assigment from unaligned pointer, it forces + * the compiler to generate extra instructions and satisfy architectural + * alignment requirements. + */ +template<typename T> struct UnalignedData { + T value; +} __attribute__ ((packed)); + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pUint64 - Pointer to uint64_t value + * + * @return uint64_t value from specified pointer + */ +inline uint64_t UINT64_FROM_PTR(const void* i_pUint64) +{ + return reinterpret_cast<const UnalignedData<uint64_t>*>(i_pUint64)->value; +} + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pUint32 - Pointer to uint32_t value + * + * @return uint32_t value from specified pointer + */ +inline uint32_t UINT32_FROM_PTR(const void* i_pUint32) +{ + return reinterpret_cast<const UnalignedData<uint32_t>*>(i_pUint32)->value; +} + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pUint16 - Pointer to uint16_t value + * + * @return uint16_t value from specified pointer + */ +inline uint16_t UINT16_FROM_PTR(const void* i_pUint16) +{ + return reinterpret_cast<const UnalignedData<uint16_t>*>(i_pUint16)->value; +} + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pInt64 - Pointer to int64_t value + * + * @return int64_t value from specified pointer + */ +inline int64_t INT64_FROM_PTR(const void* i_pInt64) +{ + return reinterpret_cast<const UnalignedData<int64_t>*>(i_pInt64)->value; +} + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pInt32 - Pointer to int32_t value + * + * @return int32_t value from specified pointer + */ +inline int32_t INT32_FROM_PTR(const void* i_pInt32) +{ + return reinterpret_cast<const UnalignedData<int32_t>*>(i_pInt32)->value; +} + +/** + * @brief Read integral value from unaligned pointer. + * + * @param[in] i_pInt16 - Pointer to int16_t value + * + * @return int16_t value from specified pointer + */ +inline int16_t INT16_FROM_PTR(const void* i_pInt16) +{ + return reinterpret_cast<const UnalignedData<int16_t>*>(i_pInt16)->value; +} + +/** * @brief Returns the uint64_t at the pointed to location in host byte order * * @param[in] i_pUint64 Pointer to a uint64_t in network byte order @@ -47,7 +130,7 @@ namespace ERRORLOG */ inline uint64_t NTH_UINT64(const void* i_pUint64) { - return (ntohll(*(reinterpret_cast<const uint64_t*>(i_pUint64)))); + return (ntohll(UINT64_FROM_PTR(i_pUint64))); } /** @@ -59,7 +142,7 @@ inline uint64_t NTH_UINT64(const void* i_pUint64) */ inline uint32_t NTH_UINT32(const void* i_pUint32) { - return (ntohl(*(reinterpret_cast<const uint32_t*>(i_pUint32)))); + return (ntohl(UINT32_FROM_PTR(i_pUint32))); } /** @@ -71,7 +154,7 @@ inline uint32_t NTH_UINT32(const void* i_pUint32) */ inline uint16_t NTH_UINT16(const void* i_pUint16) { - return (ntohs(*(reinterpret_cast<const uint16_t*>(i_pUint16)))); + return (ntohs(UINT16_FROM_PTR(i_pUint16))); } /** |