From d1a017d3dc236be6787eb0831f278be91b3fc5f9 Mon Sep 17 00:00:00 2001 From: Mark Wenning Date: Tue, 7 Aug 2012 12:30:32 -0500 Subject: Move getMasterCore to namedtarget.C/H getMasterCore() has hb-specific code and will not compile in fsp RTC: 46451 Change-Id: Ib4d704ae6c0b5ae0dee87aed14e6bee9c678adec Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1490 Reviewed-by: MIKE J. JONES Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- .../hwp/build_winkle_images/build_winkle_images.C | 1 + src/usr/hwpf/hwp/core_activate/core_activate.C | 1 + src/usr/targeting/common/utilFilter.C | 51 ---------- src/usr/targeting/makefile | 22 +++-- src/usr/targeting/namedtarget.C | 106 +++++++++++++++++++++ 5 files changed, 121 insertions(+), 60 deletions(-) create mode 100644 src/usr/targeting/namedtarget.C (limited to 'src/usr') diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C index afabde42a..7b49ff936 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C +++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C @@ -47,6 +47,7 @@ // targeting support #include #include +#include // fapi support #include diff --git a/src/usr/hwpf/hwp/core_activate/core_activate.C b/src/usr/hwpf/hwp/core_activate/core_activate.C index e3d5596af..99d02baab 100644 --- a/src/usr/hwpf/hwp/core_activate/core_activate.C +++ b/src/usr/hwpf/hwp/core_activate/core_activate.C @@ -48,6 +48,7 @@ // targeting support #include #include +#include // fapi support #include diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C index 20acaf170..e9b211e04 100644 --- a/src/usr/targeting/common/utilFilter.C +++ b/src/usr/targeting/common/utilFilter.C @@ -212,55 +212,4 @@ const Target * getParentChip( const Target * i_pChiplet ) } -const TARGETING::Target * getMasterCore( ) -{ - uint64_t l_masterCoreID = task_getcpuid() & ~7; - const TARGETING::Target * l_masterCore = NULL; - - TARGETING::Target * l_processor = NULL; - (void)TARGETING::targetService().masterProcChipTargetHandle( l_processor ); - FABRIC_NODE_ID_ATTR l_logicalNodeId = - l_processor->getAttr(); - FABRIC_CHIP_ID_ATTR l_chipId = - l_processor->getAttr(); - - TargetHandleList l_cores; - getChildChiplets( l_cores, - l_processor, - TYPE_CORE, - true ); - - TRACDCOMP( g_trac_targeting, - "getMasterCore: found %d cores on master proc", - l_cores.size() ); - - for ( uint8_t l_coreNum=0; l_coreNum < l_cores.size(); l_coreNum++ ) - { - TARGETING::Target * l_core = l_cores[ l_coreNum ] ; - - CHIP_UNIT_ATTR l_coreId = - l_core->getAttr(); - - uint64_t pir = l_coreId << 3; - pir |= l_chipId << 7; - pir |= l_logicalNodeId << 10; - - if (pir == l_masterCoreID){ - TRACDCOMP( g_trac_targeting, - "found master core: 0x%x, PIR=0x%x :", - l_coreId, - pir ); - EntityPath l_path; - l_path = l_core->getAttr(); - l_path.dump(); - - l_masterCore = l_core ; - break; - } - - } // endfor - - return l_masterCore; -} - }; // end namespace diff --git a/src/usr/targeting/makefile b/src/usr/targeting/makefile index 661d3fbed..09d170818 100644 --- a/src/usr/targeting/makefile +++ b/src/usr/targeting/makefile @@ -1,11 +1,11 @@ -# IBM_PROLOG_BEGIN_TAG +# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: src/usr/targeting/makefile $ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011-2012 # # p1 # @@ -19,13 +19,12 @@ # # Origin: 30 # -# IBM_PROLOG_END - +# IBM_PROLOG_END_TAG ################################################################################ # # @file src/usr/targeting/makefile # -# @brief Makefile for building Hostboot's targeting implementation +# @brief Makefile for building Hostboot's targeting implementation # ################################################################################ @@ -40,7 +39,7 @@ include ${COMMON_TARGETING_MAKEFILE} VPATH = \ adapters \ ${COMMON_TARGETING_REL_PATH} \ - ${addprefix ${COMMON_TARGETING_REL_PATH}/, ${COMMON_TARGETING_SUBDIRS}} + ${addprefix ${COMMON_TARGETING_REL_PATH}/, ${COMMON_TARGETING_SUBDIRS}} ATTR_RP_OBJS = \ attrrp.o @@ -52,15 +51,20 @@ DEBUG_OBJS = \ attributestrings.o \ attributedump.o -HOSTBOOT_SPECIFIC_OBJS = ${ENTRY_POINT_OBJS} ${ATTR_RP_OBJS} ${DEBUG_OBJS} - +HOSTBOOT_SPECIFIC_OBJS = \ + ${ENTRY_POINT_OBJS} \ + ${ATTR_RP_OBJS} \ + ${DEBUG_OBJS} \ + namedtarget.o + + #debug : # @echo COMMON_TARGETING_REL_PATH = ${COMMON_TARGETING_REL_PATH} # @echo COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_MAKEFILE} # @echo COMMON_TARGETING_SUBDIRS = ${COMMON_TARGETING_SUBDIRS} # @echo VPATH = ${VPATH} # @echo COMMON_TARGETING_OBJS = ${COMMON_TARGETING_OBJS} - + OBJS = ${COMMON_TARGETING_OBJS} ${HOSTBOOT_SPECIFIC_OBJS} SUBDIRS = test.d xmltohb.d diff --git a/src/usr/targeting/namedtarget.C b/src/usr/targeting/namedtarget.C new file mode 100644 index 000000000..5de1d2dc7 --- /dev/null +++ b/src/usr/targeting/namedtarget.C @@ -0,0 +1,106 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/targeting/hbutil/namedtarget.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 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 namedtarget.C + * + * hostBoot - specific filters. This was removed from ../common because + * that source is also compiled into the fsp. + * + */ + +//****************************************************************************** +// Includes +//****************************************************************************** +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // task_getcpuid() + + +/** + * Miscellaneous Filter Utility Functions + */ + +namespace TARGETING +{ + +const TARGETING::Target * getMasterCore( ) +{ + uint64_t l_masterCoreID = task_getcpuid() & ~7; + const TARGETING::Target * l_masterCore = NULL; + + TARGETING::Target * l_processor = NULL; + (void)TARGETING::targetService().masterProcChipTargetHandle( l_processor ); + FABRIC_NODE_ID_ATTR l_logicalNodeId = + l_processor->getAttr(); + FABRIC_CHIP_ID_ATTR l_chipId = + l_processor->getAttr(); + + TargetHandleList l_cores; + getChildChiplets( l_cores, + l_processor, + TYPE_CORE, + true ); + + TRACDCOMP( g_trac_targeting, + "getMasterCore: found %d cores on master proc", + l_cores.size() ); + + for ( uint8_t l_coreNum=0; l_coreNum < l_cores.size(); l_coreNum++ ) + { + TARGETING::Target * l_core = l_cores[ l_coreNum ] ; + + CHIP_UNIT_ATTR l_coreId = + l_core->getAttr(); + + uint64_t pir = l_coreId << 3; + pir |= l_chipId << 7; + pir |= l_logicalNodeId << 10; + + if (pir == l_masterCoreID){ + TRACDCOMP( g_trac_targeting, + "found master core: 0x%x, PIR=0x%x :", + l_coreId, + pir ); + EntityPath l_path; + l_path = l_core->getAttr(); + l_path.dump(); + + l_masterCore = l_core ; + break; + } + + } // endfor + + return l_masterCore; +} + +}; // end namespace -- cgit v1.2.1