summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-08-07 12:30:32 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-08-08 14:55:07 -0500
commitd1a017d3dc236be6787eb0831f278be91b3fc5f9 (patch)
tree2f4e18627da57f594245b4c88d79a7fa49b5c1fc
parent07dfeacc5ab9399d640d00c0cf378af5b5e969c0 (diff)
downloadtalos-hostboot-d1a017d3dc236be6787eb0831f278be91b3fc5f9.tar.gz
talos-hostboot-d1a017d3dc236be6787eb0831f278be91b3fc5f9.zip
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 <mjjones@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/targeting/common/utilFilter.H7
-rw-r--r--src/include/usr/targeting/namedtarget.H52
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C1
-rw-r--r--src/usr/hwpf/hwp/core_activate/core_activate.C1
-rw-r--r--src/usr/targeting/common/utilFilter.C51
-rw-r--r--src/usr/targeting/makefile22
-rw-r--r--src/usr/targeting/namedtarget.C106
7 files changed, 173 insertions, 67 deletions
diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H
index b33afa6f6..6f49be71f 100644
--- a/src/include/usr/targeting/common/utilFilter.H
+++ b/src/include/usr/targeting/common/utilFilter.H
@@ -132,13 +132,6 @@ void getAllLogicalCards( TARGETING::TargetHandleList & o_vector,
bool i_functional = true );
-/**
- * @brief find master core in system
- *
- * @return master target core, NULL otherwise
- */
-const TARGETING::Target * getMasterCore( );
-
}
#endif // __TARGETING_COMMON_UTIL_H
diff --git a/src/include/usr/targeting/namedtarget.H b/src/include/usr/targeting/namedtarget.H
new file mode 100644
index 000000000..0c481b161
--- /dev/null
+++ b/src/include/usr/targeting/namedtarget.H
@@ -0,0 +1,52 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/targeting/hbutil/hbFilter.H $
+ *
+ * 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
+ */
+#ifndef __TARGETING_UTIL_NAMEDTARGET_H
+#define __TARGETING_UTIL_NAMEDTARGET_H
+
+/**
+ * @file namedtarget.H
+ *
+ * @brief hostBoot-specific Targeting Filter utility functions
+ */
+
+#include <attributeenums.H>
+#include <targeting/common/predicates/predicatebase.H>
+#include <targeting/common/iterators/targetiterator.H>
+#include <targeting/common/iterators/rangefilter.H>
+
+
+namespace TARGETING
+{
+
+
+/**
+ * @brief find master core in system
+ *
+ * @return master target core, NULL otherwise
+ */
+const TARGETING::Target * getMasterCore( );
+
+} // end namespace
+
+#endif
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 <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
+#include <targeting/namedtarget.H>
// fapi support
#include <fapi.H>
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 <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
+#include <targeting/namedtarget.H>
// fapi support
#include <fapi.H>
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<TARGETING::ATTR_FABRIC_NODE_ID>();
- FABRIC_CHIP_ID_ATTR l_chipId =
- l_processor->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
-
- 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<TARGETING::ATTR_CHIP_UNIT>();
-
- 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<ATTR_PHYS_PATH>();
- 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 <targeting/common/commontargeting.H>
+#include <targeting/common/entitypath.H>
+#include <targeting/common/trace.H>
+#include <attributeenums.H>
+#include <targeting/common/iterators/rangefilter.H>
+#include <targeting/common/predicates/predicateisfunctional.H>
+#include <targeting/common/predicates/predicatepostfixexpr.H>
+#include <targeting/common/utilFilter.H>
+#include <targeting/namedtarget.H>
+
+#include <sys/task.h> // 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<TARGETING::ATTR_FABRIC_NODE_ID>();
+ FABRIC_CHIP_ID_ATTR l_chipId =
+ l_processor->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
+
+ 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<TARGETING::ATTR_CHIP_UNIT>();
+
+ 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<ATTR_PHYS_PATH>();
+ l_path.dump();
+
+ l_masterCore = l_core ;
+ break;
+ }
+
+ } // endfor
+
+ return l_masterCore;
+}
+
+}; // end namespace
OpenPOWER on IntegriCloud