summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/parser
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2013-02-08 17:13:45 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-28 10:03:27 -0600
commit3d50adf7e2ba101168f6e0cb1be69d552814500f (patch)
treeeb93bb56e495ff1f03acb3cece39a065958e580f /src/usr/errl/parser
parent7d09350be4f99be134923640315755902a13c8a5 (diff)
downloadtalos-hostboot-3d50adf7e2ba101168f6e0cb1be69d552814500f.tar.gz
talos-hostboot-3d50adf7e2ba101168f6e0cb1be69d552814500f.zip
Support ERRL UD and SRC parsing in hostboot standalone
Change-Id: I16ec13f87d9a71c3e0248bf4776e9f3402be6285 RTC:49967 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3138 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/parser')
-rw-r--r--src/usr/errl/parser/errlparserbase.C81
-rwxr-xr-xsrc/usr/errl/parser/errlusrparser.C185
-rwxr-xr-xsrc/usr/errl/parser/genErrlParsers.pl34
-rw-r--r--src/usr/errl/parser/makefile5
4 files changed, 30 insertions, 275 deletions
diff --git a/src/usr/errl/parser/errlparserbase.C b/src/usr/errl/parser/errlparserbase.C
deleted file mode 100644
index 5baf03e09..000000000
--- a/src/usr/errl/parser/errlparserbase.C
+++ /dev/null
@@ -1,81 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/errl/parser/errlparserbase.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-/**
- * @file errlparsebase.C
- *
- * @brief <Brief Description of this file>
- *
- * <Detailed description of what this file does, functions it includes,
- * etc,>
-*/
-
-
-/*****************************************************************************/
-// I n c l u d e s
-/*****************************************************************************/
-#include <errl/parser/errlparserbase.H>
-
-
-///< Maximum displayable characters
-static const int LINE_WIDTH = 78;
-
-
-
-/*****************************************************************************/
-// Constructor
-/*****************************************************************************/
-ErrlParser::ErrlParser(
- FILE * i_output
-)
-{
-
-}
-
-
-/*****************************************************************************/
-// Destructor
-/*****************************************************************************/
-ErrlParser::~ErrlParser()
-{
-
-}
-
-
-/*****************************************************************************/
-// Numeric Print
-/*****************************************************************************/
-void ErrlParser::PrintNumber(
- const char * i_label,
- const char * i_fmt,
- uint32_t i_value
-)
-{
- char l_tmp[LINE_WIDTH];
-
- snprintf(l_tmp,LINE_WIDTH,i_fmt,i_value);
- l_tmp[LINE_WIDTH-1] = 0;
-
- PrintString( i_label, l_tmp );
-}
-
-
diff --git a/src/usr/errl/parser/errlusrparser.C b/src/usr/errl/parser/errlusrparser.C
deleted file mode 100755
index 569b2202d..000000000
--- a/src/usr/errl/parser/errlusrparser.C
+++ /dev/null
@@ -1,185 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/errl/parser/errlusrparser.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-/**
- * @file errlusrparser.C
- *
- * @brief <Brief Description of this file>
- *
- * <Detailed description of what this file does, functions it includes,
- * etc,>
-*/
-
-/*****************************************************************************/
-// I n c l u d e s
-/*****************************************************************************/
-#include <cstring>
-#include <ctype.h>
-#include <cstdarg>
-
-#include <errl/parser/errlusrparser.H>
-
-/*****************************************************************************/
-// Constant string defines
-/*****************************************************************************/
-const char * ERRL_MSG_UNKNOWN = "Unknown";
-const char * ERRL_MSG_BOOL_TRUE = "True";
-const char * ERRL_MSG_BOOL_FALSE = "False";
-const char * ERRL_MSG_STR_ENABLED = "Enabled";
-const char * ERRL_MSG_STR_DISABLED = "Disabled";
-
-
-/*****************************************************************************/
-// Send the label & return # of chars printed
-/*****************************************************************************/
-static int PrintLabel(
- FILE * i_stream,
- const char * i_label
- )
-{
- if ( ! i_label )
- {
- i_label = "";
- }
-
- return fprintf(i_stream,"| %-25.25s: ",i_label);
-}
-
-
-/*****************************************************************************/
-// Regular string ( may be multiline )
-/*****************************************************************************/
-void ErrlUsrParser::PrintString(
- const char * i_label,
- const char * i_string
- )
-{
- // Must make sure the string fits on the available width
- int l_strlen = 0;
- int l_printed = 0;
-
-
- // Ensure String is valid
- if ( i_string )
- {
- l_strlen = strlen( i_string );
- }
-
- // Fake a blank string
- if ( ! l_strlen )
- {
- l_strlen = 1;
- i_string = " ";
- }
-
- // Print it out
- while ( l_strlen > l_printed )
- {
- // Leader ( label or blanks )
- PrintLabel( iv_Stream, i_label );
-
- // label is only printed once
- i_label = "";
-
- l_printed += fprintf(
- iv_Stream,
- "%-50.50s",
- i_string+l_printed
- );
-
- fprintf(iv_Stream,"|\n");
- }
-}
-/*****************************************************************************/
-// Numeric Print
-/*****************************************************************************/
-void ErrlUsrParser::PrintNumber(
- const char * i_label,
- const char * i_fmt,
- uint32_t i_value
- ){
- ErrlParser::PrintNumber( i_label, i_fmt, i_value );
-}
-
-
-/*****************************************************************************/
-// Hex Dump
-/*****************************************************************************/
-void ErrlUsrParser::PrintHexDump(
- const void * i_data,
- uint32_t i_len
- )
-{
- uint32_t i = 0 ;
- uint32_t l_counter = 0;
- uint32_t l_written;
- uint8_t *l_data = (uint8_t*)i_data;
-
- while ( l_counter < i_len)
- {
- fprintf(iv_Stream,"| %08X ",l_counter);
-
- // Display 16 bytes in Hex with 2 spaces in between
- l_written = 0;
- for ( i = 0; i < 16 && l_counter < i_len; i++ )
- {
- l_written += fprintf(iv_Stream,"%02X",l_data[l_counter++]);
-
- if ( ! ( l_counter % 4 ) )
- {
- l_written += fprintf(iv_Stream," ");
- }
- }
-
- // Pad with spaces
- fprintf(iv_Stream,"%-*c",43-l_written,' ');
-
- // Display ASCII -- fk1
- l_written = 0;
- uint8_t l_char;
- for ( ; i > 0 ; i-- )
- {
- l_char = l_data[ l_counter-i ];
-
- if ( isprint( l_char ) &&
- ( l_char != '&' ) &&
- ( l_char != '<' ) &&
- ( l_char != '>' )
- )
- {
- l_written += fprintf( iv_Stream,"%c",l_char );
- }
- else
- {
- l_written += fprintf( iv_Stream,"." );
- }
- }
-
- // Pad with spaces -- fk1
- fprintf( iv_Stream,"%-*c|\n",19-l_written,' ' );
-
-
-
- }
-}
-
-
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl
index 33ddabbdc..bd36799dd 100755
--- a/src/usr/errl/parser/genErrlParsers.pl
+++ b/src/usr/errl/parser/genErrlParsers.pl
@@ -737,14 +737,19 @@ print OFILE "\# Do not modify this file in the FSP tree, it is provided by\n";
print OFILE "\# Hostboot and will be overwritten\n";
print OFILE "\#\n";
print OFILE "CFLAGS += -DPARSER\n\n";
+print OFILE "EXPLIBS =\n\n";
print OFILE "\#-------------------------------------------------------------\n";
print OFILE "\# SRC Parsers\n";
print OFILE "\#-------------------------------------------------------------\n";
foreach my $compValue (keys %compValueToParseHash)
{
- print OFILE "libB-$compValue" . "00.so_OFILES = hbfwSrcParse$compValue.o\n";
- print OFILE "libB-$compValue" . "00.so_EXTRA_LIBS = libbase.so\n\n";
+ print OFILE ".if ( \$(CONTEXT) != \"x86.nfp\" )\n";
+ print OFILE "\tlibB-$compValue" . "00.so_OFILES = hbfwSrcParse$compValue.o\n";
+ print OFILE "\tlibB-$compValue" . "00.so_EXTRA_LIBS = libbase.so\n\n";
+ print OFILE ".else\n";
+ print OFILE "\tlibB-$compValue" . "00.a_OFILES = hbfwSrcParse$compValue.o\n";
+ print OFILE ".endif\n";
}
print OFILE "\#-------------------------------------------------------------\n";
@@ -752,18 +757,39 @@ print OFILE "\# User Detail Data Parsers\n";
print OFILE "\#-------------------------------------------------------------\n";
foreach my $compValue (keys %compValToUdFilesHash)
{
- print OFILE "libB-$compValue" . "00.so_OFILES += $compValToUdFilesHash{$compValue}\n\n";
+ print OFILE ".if ( \$(CONTEXT) != \"x86.nfp\" )\n";
+ print OFILE "libB-$compValue" . "00.so_OFILES += $compValToUdFilesHash{$compValue}\n";
+ print OFILE ".else\n";
+ print OFILE "libB-$compValue" . "00.a_OFILES += $compValToUdFilesHash{$compValue}\n";
+ print OFILE ".endif\n";
+
}
+print OFILE ".if ( \$(CONTEXT) != \"x86.nfp\" )\n";
print OFILE "\#-------------------------------------------------------------\n";
print OFILE "\# Shared library for each component\n";
print OFILE "\#-------------------------------------------------------------\n";
print OFILE "SHARED_LIBRARIES = ";
-
foreach my $compValue (keys %compValueToParseHash)
{
print OFILE "libB-$compValue" . "00.so ";
}
+print OFILE "\n.else\n";
+print OFILE "\#-------------------------------------------------------------\n";
+print OFILE "\# x86 mode generate an archive file for each component\n";
+print OFILE "\#-------------------------------------------------------------\n";
+print OFILE "LIBRARIES = ";
+foreach my $compValue (keys %compValueToParseHash)
+{
+ print OFILE "libB-$compValue" . "00.a ";
+}
+print OFILE "\nEXPLIBS = ";
+foreach my $compValue (keys %compValueToParseHash)
+{
+ print OFILE "libB-$compValue" . "00.a ";
+}
+print OFILE "\n.endif\n";
+
print OFILE "\n\n.include<\${RULES_MK}>\n";
diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile
index 69451597a..7e5628c05 100644
--- a/src/usr/errl/parser/makefile
+++ b/src/usr/errl/parser/makefile
@@ -52,11 +52,6 @@ gen_pass: mkdirs ${GENDIR}/comps.C ${ERRLPARSE_TARGETS}
code_pass: ${IMGDIR}/errlparser
-# errlparserbase and errlusrparser are plugins stuff, not errlparser.
-# OBJFILES = ${OBJDIR}/errlparserbase.o ${OBJDIR}/errlusrparser.o
-# %.o : %.C
-# $(CC) -c $(CFLAGS) -o $@ $<
-
mkdirs:
mkdir -p ${OBJDIR}
mkdir -p ${GENDIR}
OpenPOWER on IntegriCloud