summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-02-09 15:49:26 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2017-02-17 13:52:10 -0500
commita3fd64b53ed779b957ef071430c4b80491a33ac1 (patch)
tree6b7d2b4d6822647ca339de2c984b5ed128c08cee /src/usr/diag/prdf
parent61a53e411873196590c2cf97b7b97e8e1418460d (diff)
downloadtalos-hostboot-a3fd64b53ed779b957ef071430c4b80491a33ac1.tar.gz
talos-hostboot-a3fd64b53ed779b957ef071430c4b80491a33ac1.zip
PRD: add BitString support to error log parsing code
Change-Id: Iab3eab5f87d1ff466657fd505ef1940859a7ec02 RTC: 169103 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36251 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Squashed: I6835e9d4c51fb3697287e6556a2be347912c7136 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36513 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf')
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/register/iipscr.C2
-rw-r--r--src/usr/diag/prdf/common/plugins/plugins.mk3
-rwxr-xr-xsrc/usr/diag/prdf/common/prdf_types.h9
-rwxr-xr-xsrc/usr/diag/prdf/common/util/prdfAssert.h29
-rwxr-xr-xsrc/usr/diag/prdf/common/util/prdfBitString.C12
-rwxr-xr-xsrc/usr/diag/prdf/common/util/prdfBitString.H21
-rw-r--r--src/usr/diag/prdf/plugins/makefile4
-rwxr-xr-xsrc/usr/diag/prdf/rule/makefile5
8 files changed, 55 insertions, 30 deletions
diff --git a/src/usr/diag/prdf/common/framework/register/iipscr.C b/src/usr/diag/prdf/common/framework/register/iipscr.C
index f6d386f17..d4d7017a2 100755
--- a/src/usr/diag/prdf/common/framework/register/iipscr.C
+++ b/src/usr/diag/prdf/common/framework/register/iipscr.C
@@ -45,6 +45,8 @@
#include <iipscr.h>
#include <iipconst.h>
+#include <prdfAssert.h>
+
namespace PRDF
{
/*--------------------------------------------------------------------*/
diff --git a/src/usr/diag/prdf/common/plugins/plugins.mk b/src/usr/diag/prdf/common/plugins/plugins.mk
index 3e3024683..4070476c8 100644
--- a/src/usr/diag/prdf/common/plugins/plugins.mk
+++ b/src/usr/diag/prdf/common/plugins/plugins.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2016
+# Contributors Listed Below - COPYRIGHT 2013,2017
# [+] International Business Machines Corp.
#
#
@@ -37,6 +37,7 @@ LIBRARY_OFILES += prdfMemLogParse.o
#LIBRARY_OFILES += prdfProcLogParse.o TODO RTC 136050
LIBRARY_OFILES += prdrErrlPluginsSupt.o
LIBRARY_OFILES += prdfParserUtils.o
+LIBRARY_OFILES += prdfBitString.o
LIBFLAGS = -Efips/lib
diff --git a/src/usr/diag/prdf/common/prdf_types.h b/src/usr/diag/prdf/common/prdf_types.h
index a6035e8f1..78ce4076e 100755
--- a/src/usr/diag/prdf/common/prdf_types.h
+++ b/src/usr/diag/prdf/common/prdf_types.h
@@ -31,6 +31,15 @@
#undef NULL
#define NULL 0
+#if defined(PRDF_HOSTBOOT_ERRL_PLUGIN) || defined(PRDF_FSP_ERRL_PLUGIN)
+ // The error log parser is always compiled with the x86_64-mcp8-jail, which
+ // does not support C++11, yet. Therefore, define nullptr so we don't have
+ // to revert a bunch of new code.
+ #ifndef nullptr
+ #define nullptr NULL
+ #endif
+#endif
+
namespace PRDF
{
diff --git a/src/usr/diag/prdf/common/util/prdfAssert.h b/src/usr/diag/prdf/common/util/prdfAssert.h
index c196e73e5..b698c3fd5 100755
--- a/src/usr/diag/prdf/common/util/prdfAssert.h
+++ b/src/usr/diag/prdf/common/util/prdfAssert.h
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2004,2014 */
+/* Contributors Listed Below - COPYRIGHT 2004,2017 */
+/* [+] 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. */
@@ -31,15 +33,24 @@
namespace PRDF
{
-#define PRDF_ASSERT(x) { if(!(x)) { prdfAssert(#x,__FILE__,__LINE__); } }
+#if defined(PRDF_HOSTBOOT_ERRL_PLUGIN) || defined(PRDF_FSP_ERRL_PLUGIN)
-/**
- * @brief PRD implementation of assert().
- * @param i_exp A boolean expression.
- * @param i_file The file calling assert().
- * @param i_line The line of the file in which assert() is called.
- */
-void prdfAssert( const char * i_exp, const char * i_file, int i_line );
+ // Special case for error log parsing code.
+ #define PRDF_ASSERT(x) (void) 0
+
+#else
+
+ #define PRDF_ASSERT(x) { if(!(x)) { prdfAssert(#x,__FILE__,__LINE__); } }
+
+ /**
+ * @brief PRD implementation of assert().
+ * @param i_exp A boolean expression.
+ * @param i_file The file calling assert().
+ * @param i_line The line of the file in which assert() is called.
+ */
+ void prdfAssert( const char * i_exp, const char * i_file, int i_line );
+
+#endif
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/util/prdfBitString.C b/src/usr/diag/prdf/common/util/prdfBitString.C
index b8c7b5dc0..73572a4db 100755
--- a/src/usr/diag/prdf/common/util/prdfBitString.C
+++ b/src/usr/diag/prdf/common/util/prdfBitString.C
@@ -27,11 +27,9 @@
* @brief BitString and BitStringBuffer class Definitions
*/
-#define PRDFBITSTRING_CPP
-
#include <prdfBitString.H>
-#undef PRDFBITSTRING_CPP
+#include <prdfAssert.h>
#include <algorithm>
@@ -42,6 +40,12 @@ namespace PRDF
// BitString class
//##############################################################################
+const uint32_t BitString::CPU_WORD_BIT_LEN = sizeof(CPU_WORD) * 8;
+
+const CPU_WORD BitString::CPU_WORD_MASK = static_cast<CPU_WORD>(-1);
+
+//------------------------------------------------------------------------------
+
CPU_WORD BitString::getField( uint32_t i_pos, uint32_t i_len ) const
{
PRDF_ASSERT( nullptr != getBufAddr() ); // must to have a valid address
@@ -465,7 +469,7 @@ void BitStringBuffer::initBuffer()
std::ostream & operator<<(std::ostream & out,
const BitString & bit_string )
{
- const uint32_t bit_field_length = CPU_WORD_BIT_LEN;
+ const uint32_t bit_field_length = BitString::CPU_WORD_BIT_LEN;
out << std::hex;
for(uint32_t pos = 0; pos < bit_string.getBitLen(); pos += bit_field_length)
{
diff --git a/src/usr/diag/prdf/common/util/prdfBitString.H b/src/usr/diag/prdf/common/util/prdfBitString.H
index 028eb915c..bd2e45eae 100755
--- a/src/usr/diag/prdf/common/util/prdfBitString.H
+++ b/src/usr/diag/prdf/common/util/prdfBitString.H
@@ -30,9 +30,7 @@
* @brief BitString and BitStringBuffer class declarations
*/
-#if !defined(PRDF_TYPES_H)
#include <prdf_types.h>
-#endif
#if defined(ESW_SIM_COMPILE)
#define _USE_IOSTREAMS_
@@ -43,8 +41,6 @@
#include <iomanip>
#endif
-#include <prdfAssert.h>
-
namespace PRDF
{
@@ -54,15 +50,6 @@ class BitStringBuffer;
* size for a specific CPU architecture. */
typedef uint32_t CPU_WORD;
-/** Size of a CPU_WORD */
-constexpr uint32_t CPU_WORD_SIZE = sizeof(CPU_WORD);
-
-/** Bit length of a CPU_WORD */
-constexpr uint32_t CPU_WORD_BIT_LEN = CPU_WORD_SIZE * 8;
-
-/** A CPU_WORD with all of the bits set to 1. */
-constexpr CPU_WORD CPU_WORD_MASK = static_cast<CPU_WORD>(-1);
-
//##############################################################################
// BitString class
//##############################################################################
@@ -99,6 +86,14 @@ constexpr CPU_WORD CPU_WORD_MASK = static_cast<CPU_WORD>(-1);
*/
class BitString
{
+ public: // constants
+
+ /** Bit length of a CPU_WORD */
+ static const uint32_t CPU_WORD_BIT_LEN;
+
+ /** A CPU_WORD with all of the bits set to 1 */
+ static const CPU_WORD CPU_WORD_MASK;
+
public: // functions
/**
diff --git a/src/usr/diag/prdf/plugins/makefile b/src/usr/diag/prdf/plugins/makefile
index c2fab1948..7919a50dc 100644
--- a/src/usr/diag/prdf/plugins/makefile
+++ b/src/usr/diag/prdf/plugins/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2015
+# Contributors Listed Below - COPYRIGHT 2013,2017
# [+] International Business Machines Corp.
#
#
@@ -23,7 +23,7 @@
#
# IBM_PROLOG_END_TAG
-INCFLAGS += -I. -I.. \
+INCFLAGS += -I. -I..
CFLAGS += -DPRDF_HOSTBOOT_ERRL_PLUGIN
diff --git a/src/usr/diag/prdf/rule/makefile b/src/usr/diag/prdf/rule/makefile
index 8efda956d..676b9e192 100755
--- a/src/usr/diag/prdf/rule/makefile
+++ b/src/usr/diag/prdf/rule/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2016
+# Contributors Listed Below - COPYRIGHT 2016,2017
# [+] International Business Machines Corp.
#
#
@@ -86,6 +86,9 @@ SOURCE_PLUGIN_DIRS += ${SRC_USR}/plugins
# Individual source files to link.
SOURCE_PLUGIN_FILES += ${SRC_USR}/common/rule/prdf_rule.mk
SOURCE_PLUGIN_FILES += ${SRC_USR}/common/rule/tables.mk
+SOURCE_PLUGIN_FILES += ${SRC_USR}/common/util/prdfAssert.h
+SOURCE_PLUGIN_FILES += ${SRC_USR}/common/util/prdfBitString.C
+SOURCE_PLUGIN_FILES += ${SRC_USR}/common/util/prdfBitString.H
SOURCE_PLUGIN_FILES += ${SRC_USR}/common/util/UtilHash.H
SOURCE_PLUGIN_FILES += ${SRC_USR}/common/plat/mem/prdfMemConst.H
SOURCE_PLUGIN_FILES += ${SRC_USR}/common/iipconst.h
OpenPOWER on IntegriCloud