diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2012-06-14 15:23:25 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-07-09 13:41:04 -0500 |
commit | 434253f2763c99351a8c790f43704cca816ba442 (patch) | |
tree | 699483556d5c47a7cb21f87a721ce88ce3d1312b /src/include/usr/mbox | |
parent | e4a23b3b4b8a7906852a39f7fef202f04f374ce6 (diff) | |
download | talos-hostboot-434253f2763c99351a8c790f43704cca816ba442.tar.gz talos-hostboot-434253f2763c99351a8c790f43704cca816ba442.zip |
Mailbox additional error handling for Hardware errors and Invalid messages
RTC: 37990
Change-Id: I8378845ed412490a3bd214ac5198ea1fc9f19664
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1221
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/mbox')
-rw-r--r-- | src/include/usr/mbox/mboxUdParser.H | 151 | ||||
-rw-r--r-- | src/include/usr/mbox/mboxUdParserFactory.H | 54 | ||||
-rw-r--r-- | src/include/usr/mbox/mbox_queues.H | 2 | ||||
-rw-r--r-- | src/include/usr/mbox/mbox_reasoncodes.H | 57 |
4 files changed, 240 insertions, 24 deletions
diff --git a/src/include/usr/mbox/mboxUdParser.H b/src/include/usr/mbox/mboxUdParser.H new file mode 100644 index 000000000..384c2077e --- /dev/null +++ b/src/include/usr/mbox/mboxUdParser.H @@ -0,0 +1,151 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/mbox/mboxUdParser.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 + */ +#if !defined(_MBOXUDPARSER) +#define _MBOXUDPARSER + +#include <errl/errluserdetails.H> +#include <errl/errludparser.H> +#include <util/align.H> +#include <mbox/mbox_reasoncodes.H> + +namespace MBOX +{ +#if defined(PARSER) + + /** + * Parses mbox message user detail in an error log + */ + class UserDetailsParserMboxMsg : public ERRORLOG::ErrlUserDetailsParser + { + public: + + /** + * Constructor + */ + UserDetailsParserMboxMsg() {} + + /** + * Destructor + */ + virtual ~UserDetailsParserMboxMsg() {} + + /** + * Parses a mbox msg in an error log. + * + * @param[in] i_version Version of the data + * @param[in] i_parse ErrlUsrParser object for the output info + * @param[in] i_pBuffer Pointer to the buffer containing detail data + * @param[in] 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 + { + uint32_t * b32 = static_cast<uint32_t *>(i_pBuffer); + uint64_t * b64 = static_cast<uint64_t *>(b32 + 4); + + uint32_t msg_id = ntohl(*b32); + uint32_t msg_q_id = ntohl(*(b32+1)); + uint32_t msg_type = ntohl(*(b32+2)); + uint32_t msg_flag = ntohl(*(b32+3)); + uint64_t msg_dta0 = ntohll(*(b64)); + uint64_t msg_dta1 = ntohll(*(b64+1)); + uint64_t msg_extd = ntohll(*(b64+2)); + + i_parser.PrintNumber("MBOX message id: 0x%08x",msg_id); + i_parser.PrintNumber("MBOX queue id: 0x%08x",msg_q_id); + i_parser.PrintNumber("MBOX message type: 0x%08x",msg_type); + if(msg_flag & 0x80000000) + { + i_parser.PrintString("MBOX mesage is synchronous"); + } + else + { + i_parser.PrintString("MBOX message is asynchronous"); + } + + i_parser.PrintNumber("MBOX data[0]: 0x%016lx",msg_dta0); + i_parser.PrintNumber("MBOX data[1]: 0x%016lx",msg_dta1); + i_parser.PrintNumber("MBOX Extra data pointer: 0x%016lx",msg_extd); + + + if(msg_extd != 0 && i_buflen > 40) + { + i_parser.PrintString("MBOX extra data:"); + + uint8_t * b08 = static_cast<uint8_t *>(b64 + 3); + size_t len = i_buflen - 40; + + i_parser.PrintHexDump(b08,len); + + } + } + }; + +#else + class UserDetailsMboxMsg : public ERRORLOG::ErrlUserDetails + { + public: + + UserDetailsMboxMsg(uint64_t * i_mbox_msg, + size_t i_msg_byte_size, + uint64_t * i_extra_data = NULL, + size_t i_data_byte_size = 0) + { + iv_CompId = HBMBOX_COMP_ID; + iv_Version = 1; + iv_SubSection = MBOX_UDT_MBOXMSG_DATA; + iv_merge = false; + + if(i_extra_data == NULL) + { + i_data_byte_size = 0; + } + + size_t msg_size = ALIGN_8(i_msg_byte_size); + size_t dta_size = ALIGN_8(i_data_byte_size); + + uint64_t * buffer = + reinterpret_cast<uint64_t*>(reallocUsrBuf(msg_size+dta_size)); + + msg_size /= 8; + dta_size /= 8; + for(size_t i = 0; i < msg_size; ++i) + { + buffer[i] = i_mbox_msg[i]; + } + for(size_t i = 0; i < dta_size; ++i) + { + buffer[msg_size+i] = i_extra_data[i]; + } + } + + ~UserDetailsMboxMsg() {} + + }; + +#endif +}; +#endif diff --git a/src/include/usr/mbox/mboxUdParserFactory.H b/src/include/usr/mbox/mboxUdParserFactory.H new file mode 100644 index 000000000..a857e5522 --- /dev/null +++ b/src/include/usr/mbox/mboxUdParserFactory.H @@ -0,0 +1,54 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/mbox/mboxUdParserFactory.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 + */ +#if !defined(_MBOXUDPARSERFACTORY_H) +#define _MBOXUDPARSERFACTORY_H + +#if defined(PARSER) + +#include <mbox/mboxUdParser.H> +#include <mbox/mbox_reasoncodes.H> +#include <errl/errludparserfactory.H> + +namespace mbox +{ + class UserDetailsParserFactory + : public ERRORLOG::ErrlUserDetailsParserFactory + { + public: + UserDetailsParserFactory() + { + registerParser<MBOX::UserDetailsParserMboxMsg> + (MBOX_UDT_MBOXMSG_DATA); + } + + private: + + UserDetailsParserFactory(const UserDetailsParserFactory &); + UserDetailsParserFactory & operator= + (const UserDetailsParserFactory &); + }; +}; + +#endif +#endif diff --git a/src/include/usr/mbox/mbox_queues.H b/src/include/usr/mbox/mbox_queues.H index bd11f09a0..6c7134061 100644 --- a/src/include/usr/mbox/mbox_queues.H +++ b/src/include/usr/mbox/mbox_queues.H @@ -48,7 +48,7 @@ namespace MBOX // FSP mailboxes FSP_FIRST_MSGQ = 0x80000000, - FSP_MAILBOX_MSGQ = FSP_FIRST_MSGQ, + FSP_MAILBOX_MSGQ, FSP_PROGRESS_CODES_MSGQ, FSP_TRACE_MSGQ, FSP_ERRL_MSGQ, diff --git a/src/include/usr/mbox/mbox_reasoncodes.H b/src/include/usr/mbox/mbox_reasoncodes.H index 46d0b4738..ca298aad7 100644 --- a/src/include/usr/mbox/mbox_reasoncodes.H +++ b/src/include/usr/mbox/mbox_reasoncodes.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/mbox/mbox_reasoncodes.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 +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/mbox/mbox_reasoncodes.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 + */ #ifndef __MBOX_REASONCODES_H #define __MBOX_REASONCODES_H @@ -39,6 +40,7 @@ namespace MBOX MOD_MBOXSRV_FSP_MSG = 0x07, // MailboxSp::handle_hbmbox_msg MOD_MBOXSRV_SENDMSG = 0x08, // MailboxSp::send_msg MOD_MBOXSRV_INIT = 0x09, // MailboxSp::_init + MOD_MBOXSRC_UNCLAIMED = 0x0A, // MailboxSp::handleUnclaimed }; enum MBOXReasonCode @@ -60,6 +62,15 @@ namespace MBOX RC_KERNEL_REG_FAILED = HBMBOX_COMP_ID | 0x0F, RC_MAILBOX_DISABLED = HBMBOX_COMP_ID | 0x10, }; -}; + + /** + * Defins for MBOX error og user detail data sections + */ + enum mboxUserDetailDataSubsection + { + MBOX_UDT_MBOXMSG_DATA = 1, + }; + +}; #endif |