summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/targetservicestart.C
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2014-05-28 16:10:05 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-06-27 14:47:45 -0500
commit98d732a527edc1a422f0f185558a38505a68e74b (patch)
tree39f80aab49ec8f60bb1acaf07ee1717ca4b9a7a7 /src/usr/targeting/targetservicestart.C
parent98c223360ea9641fb1ab738b29c858869f5bf31d (diff)
downloadtalos-hostboot-98d732a527edc1a422f0f185558a38505a68e74b.tar.gz
talos-hostboot-98d732a527edc1a422f0f185558a38505a68e74b.zip
Add Naples support to the targeting infrastructure
Change-Id: I421e5a456a8d84a844f341e8c6fd462ad557e728 RTC: 107937 Depends-On: Ie748454257938103bdb76d7ac1b5d425bc97d348 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11330 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/targetservicestart.C')
-rw-r--r--src/usr/targeting/targetservicestart.C60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C
index 216b23618..26679bf7d 100644
--- a/src/usr/targeting/targetservicestart.C
+++ b/src/usr/targeting/targetservicestart.C
@@ -36,6 +36,7 @@
#include <stdlib.h>
// Other components
+#include <sys/misc.h>
#include <sys/task.h>
#include <targeting/common/trace.H>
#include <targeting/adapters/assertadapter.H>
@@ -73,6 +74,11 @@ namespace TARGETING
static void initializeAttributes(TargetService& i_targetService);
/**
+ * @brief Check that at least one processor of our cpu type is being targeted
+ */
+static void checkProcessorTargeting(TargetService& i_targetService);
+
+/**
* @brief Entry point for initialization service to initialize the targeting
* code
*
@@ -96,6 +102,7 @@ static void initTargeting(errlHndl_t& io_pError)
(void)l_targetService.init();
initializeAttributes(l_targetService);
+ checkProcessorTargeting(l_targetService);
// call ErrlManager function - tell him that TARG is ready!
ERRORLOG::ErrlManager::errlResourceReady(ERRORLOG::TARG);
@@ -113,6 +120,59 @@ static void initTargeting(errlHndl_t& io_pError)
TASK_ENTRY_MACRO(initTargeting);
+/**
+ * @brief Check that at least one processor of our cpu type is being targeted
+ */
+static void checkProcessorTargeting(TargetService& i_targetService)
+{
+ #define TARG_FN "checkProcessorTargeting()"
+ TARG_ENTER();
+
+ PredicateCTM l_procChip(CLASS_CHIP,TYPE_PROC);
+ ProcessorCoreType l_coreType = cpu_core_type();
+ bool l_haveOneCorrectProcessor = false;
+ TargetRangeFilter l_filter(
+ i_targetService.begin(),
+ i_targetService.end(),
+ &l_procChip);
+
+ for(;l_filter && (l_haveOneCorrectProcessor != true);++l_filter)
+ {
+ switch(l_filter->getAttr<ATTR_MODEL>())
+ {
+ case MODEL_VENICE:
+ if(l_coreType == CORE_POWER8_VENICE)
+ {
+ l_haveOneCorrectProcessor = true;
+ }
+ break;
+
+ case MODEL_MURANO:
+ if(l_coreType == CORE_POWER8_MURANO)
+ {
+ l_haveOneCorrectProcessor = true;
+ }
+ break;
+
+ case MODEL_NAPLES:
+ if(l_coreType == CORE_POWER8_NAPLES)
+ {
+ l_haveOneCorrectProcessor = true;
+ }
+ break;
+
+ default:
+ break;
+ };
+ }
+
+ TARG_ASSERT((l_haveOneCorrectProcessor == true), TARG_ERR_LOC "FATAL: No "
+ "targeted processors are of the correct type");
+
+ TARG_EXIT();
+
+ #undef TARG_FN
+}
/*
* @brief Initialize any attributes that need to be set early on
OpenPOWER on IntegriCloud