diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2012-07-28 01:01:10 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-03 10:16:38 -0500 |
commit | 2613472937813b6cfd52aaa5c40aa059a62a1285 (patch) | |
tree | 923cd39779e225b533baa7d0231cffe1d0cfaaec | |
parent | e9bb8f963406b3a1e3ef89c3955a50cde4d2b5be (diff) | |
download | talos-hostboot-2613472937813b6cfd52aaa5c40aa059a62a1285.tar.gz talos-hostboot-2613472937813b6cfd52aaa5c40aa059a62a1285.zip |
Compile Hostboot without -fshort-enums
- Removed -fshort-enums from config.mk
- Fixed incorrect buffer size calculation in target.C
- Disabled short enums in targeting compiler
- Removed unnecessary assert
- Updated enum storage space
Change-Id: Ia83f942b54bc5ee246ce8d69750081714d458dcf
RTC: 35808
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1437
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | config.mk | 9 | ||||
-rw-r--r-- | src/include/usr/errl/errlsrc.H | 49 | ||||
-rw-r--r-- | src/usr/errl/errlentry.C | 46 | ||||
-rw-r--r-- | src/usr/targeting/common/target.C | 64 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/makefile | 11 |
5 files changed, 94 insertions, 85 deletions
@@ -1,11 +1,11 @@ -# IBM_PROLOG_BEGIN_TAG +# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: config.mk $ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2010 - 2011 +# COPYRIGHT International Business Machines Corp. 2010-2012 # # p1 # @@ -19,8 +19,7 @@ # # Origin: 30 # -# IBM_PROLOG_END - +# IBM_PROLOG_END_TAG all: ${MAKE} gen_pass ${MAKE} code_pass @@ -112,7 +111,7 @@ BEAMFLAGS = \ COMMONFLAGS = -O3 -nostdlib ${EXTRACOMMONFLAGS} CFLAGS = ${COMMONFLAGS} -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\ - -Wall -Werror -fshort-enums ${CUSTOMFLAGS} + -Wall -Werror ${CUSTOMFLAGS} ASMFLAGS = ${COMMONFLAGS} -mcpu=power7 CXXFLAGS = ${CFLAGS} -nostdinc++ -fno-rtti -fno-exceptions -Wall LDFLAGS = --nostdlib --sort-common ${COMMONFLAGS} diff --git a/src/include/usr/errl/errlsrc.H b/src/include/usr/errl/errlsrc.H index ab48a93d8..8d29a54e0 100644 --- a/src/include/usr/errl/errlsrc.H +++ b/src/include/usr/errl/errlsrc.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/errlsrc.H $ -// -// 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 +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errlsrc.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-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 ERRLSRC_H #define ERRLSRC_H @@ -117,10 +118,10 @@ private: // Instance data - srcType_t iv_srcType; // SRC type, the ?? in SRC ??xxxxxx + srcType_t iv_srcType : 8; // SRC type, the ?? in SRC ??xxxxxx uint8_t iv_modId; // module ID uint16_t iv_reasonCode; // reason code - epubSubSystem_t iv_ssid; // subsystem type, the ?? in SRC xx??xxxx + epubSubSystem_t iv_ssid : 8 ; // subsystem type, the ?? in SRC xx??xxxx uint64_t iv_user1; // user data 1 uint64_t iv_user2; // user data 2 diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index 427a959cc..5f0fa4fbf 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/errl/errlentry.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 +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/errl/errlentry.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-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 + */ /** * @file errlentry.C * @@ -362,7 +363,6 @@ uint64_t ErrlEntry::flatten( void * o_pBuffer, uint64_t i_bufsize ) // when the expression given evaluates to false. If ever // these cause the compile to fail, then perhaps the size // of enum'ed types has grown unexpectedly. - CPPASSERT( 1 == sizeof(iv_Src.iv_srcType)); CPPASSERT( 2 == sizeof(iv_Src.iv_reasonCode)); CPPASSERT( 2 == sizeof(compId_t)); CPPASSERT( 1 == sizeof(iv_Src.iv_modId)); diff --git a/src/usr/targeting/common/target.C b/src/usr/targeting/common/target.C index 96e6c89e0..bd673eb58 100644 --- a/src/usr/targeting/common/target.C +++ b/src/usr/targeting/common/target.C @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/target.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 - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/targeting/common/target.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-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 + */ /** * @file targeting/common/target.C * @@ -234,6 +234,8 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const sizeof(attrClass) + sizeof(attrType) + sizeof(attrModel); + uint8_t attrEnum = ATTR_NA; + uint8_t pathPhysSize = 0; AttributeTraits<ATTR_PHYS_PATH>::Type pathPhys; if( tryGetAttr<ATTR_PHYS_PATH>(pathPhys) ) { @@ -249,8 +251,16 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const } uint8_t *pFFDC; - pFFDC = static_cast<uint8_t*>( malloc(headerSize + - pathPhysSize + pathAffSize)); + + // If there is a physical path or affinity path, the serialization code + // below prefixes an attribute type ahead of the actual structure, so need + // to compensate for the size of that attribute type, when applicable + pFFDC = static_cast<uint8_t*>( + malloc( headerSize + + pathPhysSize + + (pathPhysSize ? sizeof(attrEnum) : 0) + + pathAffSize + + (pathAffSize ? sizeof(attrEnum) : 0))); // we'll send down a '0' then HUID CLASS TYPE and MODEL uint32_t bSize = 0; // size of data in the buffer @@ -267,7 +277,7 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const if( pathPhysSize > 0) { - uint8_t attrEnum = ATTR_PHYS_PATH; + attrEnum = ATTR_PHYS_PATH; memcpy(pFFDC + bSize, &attrEnum, sizeof(attrEnum)); bSize += sizeof(attrEnum); memcpy(pFFDC + bSize, &pathPhys, pathPhysSize); @@ -276,7 +286,7 @@ uint8_t * Target::targetFFDC( uint32_t & o_size ) const if( pathAffSize > 0) { - uint8_t attrEnum = ATTR_AFFINITY_PATH; + attrEnum = ATTR_AFFINITY_PATH; memcpy(pFFDC + bSize, &attrEnum, sizeof(attrEnum)); bSize += sizeof(attrEnum); memcpy(pFFDC + bSize, &pathAff, pathAffSize); diff --git a/src/usr/targeting/xmltohb/makefile b/src/usr/targeting/xmltohb/makefile index 229e64b7d..569273b37 100644 --- a/src/usr/targeting/xmltohb/makefile +++ b/src/usr/targeting/xmltohb/makefile @@ -1,11 +1,11 @@ -# IBM_PROLOG_BEGIN_TAG +# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # -# $Source: src/usr/targeting/makefile $ +# $Source: src/usr/targeting/xmltohb/makefile $ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011-2012 # # p1 # @@ -19,8 +19,7 @@ # # Origin: 30 # -# IBM_PROLOG_END - +# IBM_PROLOG_END_TAG ################################################################################ # # @file targeting/xmltohb/makefile @@ -115,5 +114,5 @@ ${GENDIR}/%_targeting.bin: ${XMLTOHB_COMPILER_SCRIPT} ${GENDIR}/%.hb.xml \ $(addprefix --fapi-attributes-xml-file=,${GENDIR}/${XMLTOHB_FAPI_XML}) \ --src-output-dir=none --img-output-dir=$(dir $@) \ --img-output-file=$(notdir $@) \ - --vmm-consts-file=$(VMM_CONSTS_FILE) + --vmm-consts-file=$(VMM_CONSTS_FILE) --noshort-enums |