diff options
-rwxr-xr-x | src/build/mkrules/hbfw/fsp/makefile | 9 | ||||
-rwxr-xr-x | src/build/tools/hb | 145 | ||||
-rw-r--r-- | src/usr/errl/parser/errlparserbase.C | 81 | ||||
-rwxr-xr-x | src/usr/errl/parser/errlusrparser.C | 185 | ||||
-rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 34 | ||||
-rw-r--r-- | src/usr/errl/parser/makefile | 5 |
6 files changed, 69 insertions, 390 deletions
diff --git a/src/build/mkrules/hbfw/fsp/makefile b/src/build/mkrules/hbfw/fsp/makefile index e894387ce..e0bab0c95 100755 --- a/src/build/mkrules/hbfw/fsp/makefile +++ b/src/build/mkrules/hbfw/fsp/makefile @@ -37,15 +37,18 @@ OBJECTS_SUBDIRS += plugins EXPLIB_SUBDIRS += plugins EXPSHLIB_SUBDIRS += targeting plugins STANDARD_SUBDIRS += targeting plugins -RUNBVT_SUBDIRS += +RUNBVT_SUBDIRS += INCLUDES = hbdescriptor.H \ hbterminatetypes.H \ .elseif(${CONTEXT} == "x86.nfp") -.include "makefile.nfp" - +EXPINC_SUBDIRS += plugins +OBJECTS_SUBDIRS += plugins +EXPLIB_SUBDIRS += plugins +EXPSHLIB_SUBDIRS += plugins +STANDARD_SUBDIRS += plugins .endif .include <${RULES_MK}> diff --git a/src/build/tools/hb b/src/build/tools/hb index 2ebebc134..2af051e30 100755 --- a/src/build/tools/hb +++ b/src/build/tools/hb @@ -1,26 +1,26 @@ #!/bin/sh -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/build/tools/hb $ +# $Source: src/build/tools/hb $ # -# 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 execute_in_sandbox() { [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 @@ -383,121 +383,42 @@ hb_copyright_check() git diff HEAD~1 --name-only | xargs addCopyright.pl validate } - hb_errlparser() { - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 - [ -z "${SANDBOXNAME}" ] && echo "Missing SANDBOXNAME." && exit -1 [ -z "${SANDBOXROOT}" ] && echo "Missing SANDBOXROOT." && exit -1 + [ -z "${SANDBOXNAME}" ] && echo "Missing SANDBOXNAME." && exit -1 + [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` - # sanity checks + # sanity checks if [ ! -f ${DRIVER}/src/makefile ]; then echo "Cannot reach backing build: $DRIVER. You may need tokens." exit -1 fi - if [ ! -f ${HOSTBOOTROOT}/src/include/usr/hbotcompid.H ]; then - echo "Missing \$HOSTBOOTROOT/src/include/usr/hbotcompid.H" - exit -1 - fi - - if [ ! -f ${HOSTBOOTROOT}/src/include/usr/errl/hberrltypes.H ]; then - echo "Missing \$HOSTBOOTROOT/src/include/usr/errl/hberrltypes.H" - exit -1 - fi - - if [ ! -f ${HOSTBOOTROOT}/obj/genfiles/hostBootSrcParse.H ]; then - echo "Missing \$HOSTBOOTROOT/obj/genfiles/hostBootSrcParse.H" - echo "This is a generated file produced during a Hostboot build." - exit -1 - fi - - # Copy hbotcompid.H to $sb/src/fstp/fsp - mkdir -p ${SANDBOXBASE}/src/fstp/fsp - cp ${HOSTBOOTROOT}/src/include/usr/hbotcompid.H ${SANDBOXBASE}/src/fstp/fsp - - # Symlink hbotcompid.H into the export trees. - # TODO: Eventually, this will be done by src/fstp/nfp/makefile, and when - # that's ready, it will require a mk of fstp instead of this. - mkdir -p ${SANDBOXBASE}/export/x86.nfp/fips/include - cd ${SANDBOXBASE}/export/x86.nfp/fips/include - ln -sf ../../../../src/fstp/fsp/hbotcompid.H - - mkdir -p ${SANDBOXBASE}/export/ppc/fips/include - cd ${SANDBOXBASE}/export/ppc/fips/include - ln -sf ../../../../src/fstp/fsp/hbotcompid.H - - # One-time preparation and x86.nfp full build of epub and errl. - if [ ! -f ${SANDBOXBASE}/src/errl/makefile ]; then - # First time running 'hb errlparser' - echo "Preparing sandbox ..." - rm -fr ${SANDBOXBASE}/src/epub ; mkdir -p ${SANDBOXBASE}/src/epub - rm -fr ${SANDBOXBASE}/src/errl ; mkdir -p ${SANDBOXBASE}/src/errl - - # TODO When the backing build has Hostboot awareness, remove this - # copying from Monte's public directory. Requirement SW105241. - if [ -d /gsa/ausgsa/home/c/o/copelanm/public/mamatha/errl ]; then - # Copy patch version of epub_service_codes.H - cp -a ${DRIVER}/src/epub/* ${SANDBOXBASE}/src/epub - cp /gsa/ausgsa/home/c/o/copelanm/public/mamatha/epub/fsp/epub_service_codes.H ${SANDBOXBASE}/src/epub/fsp - - # Copy errl patch. - cp -a /gsa/ausgsa/home/c/o/copelanm/public/mamatha/errl/* ${SANDBOXBASE}/src/errl - else - # Populate with stuff from backing build. - cp -a ${DRIVER}/src/epub/* ${SANDBOXBASE}/src/epub - cp -a ${DRIVER}/src/errl/* ${SANDBOXBASE}/src/errl - fi - - # Trigger a full local build this one time. - # Next time can be a partial build. - execute_in_sandbox "cd ${SANDBOXBASE}/src/epub && mk -a" "x86.nfp" - execute_in_sandbox "cd ${SANDBOXBASE}/src/errl && mk -a" "x86.nfp" - fi - - # (Re-)Copy Hostboot plugins sources so they are up to date. - rm -fr ${SANDBOXBASE}/src/plugins - mkdir -p ${SANDBOXBASE}/src/plugins - - # Locate and copy plugins directories for Hostboot components. - PLUGDIRS=`find ${HOSTBOOTROOT}/src/usr -name plugins -type d` - ALLCOMPS="" - - for D in $PLUGDIRS; do - COMP=`echo $D | sed 's/^.*\/src\/usr\///' | awk '-F/' '{print $1}' ` - mkdir ${SANDBOXBASE}/src/plugins/$COMP - cp -a ${HOSTBOOTROOT}/src/usr/$COMP/plugins/* ${SANDBOXBASE}/src/plugins/$COMP - ALLCOMPS="$ALLCOMPS $COMP" - done + # make sure the srci and errl dirs are present + # x86.nfp context + mkdir -p ${SANDBOXBASE}/src/srci + mkdir -p ${SANDBOXBASE}/src/errl - # Build a src/plugins/makefile with the component names found above. - echo "# This file auto-generated from ${HOSTBOOTROOT}/src/usr/errl/plugins/makefile.fips" >${SANDBOXBASE}/src/plugins/makefile - echo "HBCOMPS=$ALLCOMPS" >>${SANDBOXBASE}/src/plugins/makefile - grep -v "^ *#" ${HOSTBOOTROOT}/src/usr/errl/plugins/fips.mk >>${SANDBOXBASE}/src/plugins/makefile + # Trigger a build of the hostboot plugins we shipped with the + # hb prime cmd. + execute_in_sandbox "cd ${SANDBOXBASE}/src/hbfw/ \ + && mk -a " "x86.nfp" - # Copy common plugins.mk included by all plugins makefiles. - cp ${HOSTBOOTROOT}/src/usr/errl/plugins/plugins.mk ${SANDBOXBASE}/src/plugins + # build srci in x86 context + execute_in_sandbox "cd ${SANDBOXBASE}/src/srci \ + && mk -a " "x86.nfp" - # Clean any libB* symlinks in the export tree. - find ${SANDBOXBASE}/export/x86.nfp/fips/lib -name "libB*" -exec rm {} \; 2>/dev/null + # build errl in x86 context, to pick-up the parser libs from + # hostboot. + execute_in_sandbox "cd ${SANDBOXBASE}/src/errl \ + && mk -a " "x86.nfp" - # Build all libB* plugins from scratch every time. This should not take long. - execute_in_sandbox "cd ${SANDBOXBASE}/src/plugins && mk -a" "x86.nfp" - - # Ensure the errl binary is gone in order to trigger - # a relink to pick up changed libB*.a files - mkdir -p ${SANDBOXBASE}/src/errl - mkdir -p ${SANDBOXBASE}/obj/x86.nfp/errl/nfp/tool - rm -f ${SANDBOXBASE}/obj/x86.nfp/errl/nfp/tool/errl - execute_in_sandbox "cd ${SANDBOXBASE}/src/errl && mk" "x86.nfp" - - # Get the x86 errl tool to simics directory - # cp $SANDBOXBASE/obj/x86.nfp/errl/nfp/tool/errl $SANDBOXBASE/simics cd ${SANDBOXBASE}/simics - ln -sf ../obj/x86.nfp/errl/nfp/tool/errl + tar -xvf $SANDBOXBASE/obj/x86.nfp/errl/nfp/tool/errl.tar errl } hb_cachesync() 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} |