From 73cad1f1ae2a9f7b4876f61c5db85c35bbd08db3 Mon Sep 17 00:00:00 2001 From: Venkatesh Sainath Date: Wed, 6 Jun 2018 09:53:43 -0500 Subject: Pushing HB plugins and related files for building errltool Change-Id: I91d432a901fb4ee6de469ca8076637eaa2e1315d Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/60027 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Sampa Misra Reviewed-by: William G. Hoffa Reviewed-by: Daniel M. Crowell --- src/usr/errl/parser/genErrlParsers.pl | 55 ++++++++++++++++++++++++++++++++++- src/usr/errl/plugins/errludparser.H | 6 +++- src/usr/errl/plugins/errludsensor.H | 3 +- src/usr/errl/plugins/errludstate.H | 3 +- 4 files changed, 63 insertions(+), 4 deletions(-) (limited to 'src/usr/errl') diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index ff9bb8461..1d3af664d 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -978,6 +978,59 @@ foreach my $dir(@pluginDirsToParse) $compValToUdFilesHash{$compVal} = $ofiles; } +#------------------------------------------------------------------------------ +# Generate the makefile that builds the Hostboot error log parsers for errltool +#------------------------------------------------------------------------------ +$outputFileName = $outputDir . "/Makefile"; +open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!"); + +print OFILE "\# Automatically generated by Hostboot's $0\n"; +print OFILE "\# Do not modify this file in the errltool tree, it is provided by\n"; +print OFILE "\# Hostboot and will be overwritten\n"; +print OFILE "\#\n"; + +print OFILE "CXXFLAGS += -D__HOSTBOOT_MODULE -DLOGPARSER \n\n"; +print OFILE "CXXFLAGS += -I. -I../ -I../targeting -I../../include -I../../include/util -I../../include/extras -I../../include/genfiles\n\n"; + +print OFILE "LDFLAGS += -static\n\n"; + +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "\# Call PRD makefile for prdf plugins\n"; +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "SUBDIRS = prdf\n\n"; + +print OFILE "CMDS = libhbplugins.a\n\n"; + +print OFILE "\#-------------------------------------------------------------\n"; +print OFILE "\# SRC Parsers\n"; +print OFILE "\#-------------------------------------------------------------\n"; + +print OFILE "HB_PLUGIN_SRC_OBJS = "; +foreach my $compValue (keys %compValueToParseHash) +{ + print OFILE "\\\n"; + print OFILE " hbfwSrcParse$compValue.o "; +} + +print OFILE "\n\n"; +print OFILE "all: \$(CMDS)\n"; +print OFILE "\t\@\$(MAKE) -C prdf\n\n"; +print OFILE "libhbplugins.a: \$(HB_PLUGIN_SRC_OBJS)\n"; +print OFILE "\t\@echo \"LD \$(WORK_DIR)/\$\@\"\n"; +print OFILE "\tar rvs \$\@ \$(HB_PLUGIN_SRC_OBJS)\n\n"; + +print OFILE "\$(HB_PLUGIN_SRC_OBJS):%.o: %.C\n"; +print OFILE "\t\@echo \"\$(CC) \$(CXXFLAGS) \$(WORK_DIR)/\$\@\"\n"; +print OFILE "\t\$(CC) \$(CXXFLAGS) -c \$<\n\n"; + +print OFILE "clean:\n"; +print OFILE "\t\@echo \"Cleaning up \$(WORK_DIR) files...\"\n"; +print OFILE "\trm -rf \$(CMDS) \$(HB_PLUGIN_SRC_OBJS)\n"; +print OFILE "\t\@\$(foreach d,\$(SUBDIRS), \$(MAKE) -C \$d clean;)\n\n"; + +print OFILE "\n\ninclude ../../rules.mk\n"; + +close(OFILE); #------------------------------------------------------------------------------ # Generate the FSP makefile that builds the Hostboot error log parsers #------------------------------------------------------------------------------ @@ -989,7 +1042,7 @@ 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 "CFLAGS += -DPARSER \n\n"; print OFILE "EXPLIBS =\n\n"; print OFILE "\#-------------------------------------------------------------\n"; diff --git a/src/usr/errl/plugins/errludparser.H b/src/usr/errl/plugins/errludparser.H index 7b44109bc..ddaadade7 100755 --- a/src/usr/errl/plugins/errludparser.H +++ b/src/usr/errl/plugins/errludparser.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* [+] 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. */ @@ -33,6 +35,7 @@ #include +#ifndef LOGPARSER /** * @brief Endian swap a uint64_t. This is not provided by in.h */ @@ -57,6 +60,7 @@ inline uint64_t ntohll( uint64_t i ) #else #error Unexpected endian context. #endif +#endif // FSP includes #include diff --git a/src/usr/errl/plugins/errludsensor.H b/src/usr/errl/plugins/errludsensor.H index cdca6631e..630b45591 100644 --- a/src/usr/errl/plugins/errludsensor.H +++ b/src/usr/errl/plugins/errludsensor.H @@ -33,8 +33,9 @@ */ #include "errluserdetails.H" +#ifndef LOGPARSER #include - +#endif namespace ERRORLOG { diff --git a/src/usr/errl/plugins/errludstate.H b/src/usr/errl/plugins/errludstate.H index ac6517b17..99d53c260 100644 --- a/src/usr/errl/plugins/errludstate.H +++ b/src/usr/errl/plugins/errludstate.H @@ -33,8 +33,9 @@ */ #include "errluserdetails.H" +#ifndef LOGPARSER #include - +#endif namespace ERRORLOG { -- cgit v1.2.1