summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/targeting/common/targetservice.H16
-rw-r--r--src/usr/targeting/common/targetservice.C38
2 files changed, 51 insertions, 3 deletions
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index 157372126..397aec0c1 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -372,6 +372,13 @@ class TargetService
friend class _TargetRawIterator<const Target*>;
/**
+ * @brief Return the value of iv_processorModel
+ *
+ * @return ATTR_MODEL_type the model type of the master processor
+ */
+ ATTR_MODEL_type getProcessorModel(void);
+
+ /**
* @brief Returns the top level physical target
*
* Returns the top level (usually system) target. Caller must check
@@ -1104,9 +1111,16 @@ class TargetService
*/
void _setTopLevelTarget();
+ /**
+ * @brief Set the instance variable iv_processorModel to be the value of
+ * attribute ATTR_MODEL of the master processor
+ */
+ void _setProcessorModel(void);
+
// Instance variables
bool iv_initialized; ///< Is service initialized or not
Target * iv_pSys; // Top Level Target
+ ATTR_MODEL_type iv_processorModel; // Model of the master processor
NodeData_t iv_nodeData;
diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C
index e3c3dde92..11d9022b9 100644
--- a/src/usr/targeting/common/targetservice.C
+++ b/src/usr/targeting/common/targetservice.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -115,7 +115,8 @@ TRAC_INIT(&g_trac_targeting, "TARG", 4096);
TargetService::TargetService() :
iv_initialized(false),
- iv_pSys(NULL)
+ iv_pSys(NULL),
+ iv_processorModel(MODEL_NA)
{
#define TARG_FN "TargetService()"
@@ -215,6 +216,11 @@ void TargetService::init(const size_t i_maxNodes)
// call to set the top TYPE_SYS target
_setTopLevelTarget();
+
+ // Lookup the master processor's ATTR_MODEL attribute and set
+ // the instance variable on the targetService object for quick
+ // future reference
+ _setProcessorModel();
}
TARG_EXIT();
@@ -223,6 +229,34 @@ void TargetService::init(const size_t i_maxNodes)
}
//******************************************************************************
+// TargetService:: _setProcessorModel
+//******************************************************************************
+void TargetService::_setProcessorModel(void)
+{
+ #define TARG_FN "setProcessorModel()"
+ TARG_ENTER();
+
+ TargetHandle_t masterProc = NULL;
+ masterProcChipTargetHandle( masterProc );
+
+ TARG_ASSERT(masterProc, "Failed to find master processor, SW error, check MRW / XML " );
+
+ iv_processorModel = masterProc->getAttr<ATTR_MODEL>();
+
+ TARG_EXIT();
+ #undef TARG_FN
+ return;
+}
+
+//******************************************************************************
+// TargetService:: getProcessorModel
+//******************************************************************************
+ATTR_MODEL_type TargetService::getProcessorModel(void)
+{
+ return iv_processorModel;
+}
+
+//******************************************************************************
// TargetService:: _setTopLevelTarget
//******************************************************************************
OpenPOWER on IntegriCloud