diff options
author | Brian Silver <bsilver@us.ibm.com> | 2014-05-28 16:10:05 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-06-27 14:47:45 -0500 |
commit | 98d732a527edc1a422f0f185558a38505a68e74b (patch) | |
tree | 39f80aab49ec8f60bb1acaf07ee1717ca4b9a7a7 /src/usr/targeting/targetservicestart.C | |
parent | 98c223360ea9641fb1ab738b29c858869f5bf31d (diff) | |
download | talos-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.C | 60 |
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 |