summaryrefslogtreecommitdiffstats
path: root/src/usr/util/utillidpnor.C
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2014-12-19 14:16:51 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-01-22 17:19:04 -0600
commit32c1363b48266e3c10a37345225d35f06c863073 (patch)
tree37161ddaf45dad2f26dbfb17dac015e05beb4eb3 /src/usr/util/utillidpnor.C
parentf8569146fb30162c9bc9d4730d0476f209071fac (diff)
downloadblackbird-hostboot-32c1363b48266e3c10a37345225d35f06c863073.tar.gz
blackbird-hostboot-32c1363b48266e3c10a37345225d35f06c863073.zip
allow lid to be read from pnor at runtime
RTC:116595 Change-Id: I446c314e6675227293e50121b47d091276b817b0 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15000 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/util/utillidpnor.C')
-rw-r--r--src/usr/util/utillidpnor.C65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/usr/util/utillidpnor.C b/src/usr/util/utillidpnor.C
new file mode 100644
index 000000000..bd178d85a
--- /dev/null
+++ b/src/usr/util/utillidpnor.C
@@ -0,0 +1,65 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/util/utillidpnor.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#include <util/utillidmgr.H>
+#include <utility>
+#include "utillidpnor.H"
+
+bool UtilLidMgr::getLidPnorSection(uint32_t i_lidId,
+ PNOR::SectionInfo_t &o_lidPnorInfo)
+{
+ errlHndl_t l_err = NULL;
+ bool l_lidInPnor = false;
+
+ const std::pair<uint32_t, PNOR::SectionId> l_lid(i_lidId,
+ PNOR::INVALID_SECTION);
+
+ const std::pair<uint32_t, PNOR::SectionId>* l_result =
+ std::lower_bound (Util::lidToPnor,
+ Util::lidToPnor + Util::NUM_LID_TO_PNOR,
+ l_lid,
+ Util::cmpLidToPnor);
+
+ if (l_result != (Util::lidToPnor + Util::NUM_LID_TO_PNOR) &&
+ l_result->first == l_lid.first &&
+ l_result->second != PNOR::INVALID_SECTION)
+ {
+ l_err = PNOR::getSectionInfo(l_result->second, o_lidPnorInfo);
+ // Section is optional or lid is not in PNOR, so just delete error
+ if (l_err)
+ {
+ o_lidPnorInfo.id = PNOR::INVALID_SECTION;
+ l_lidInPnor = false;
+ delete l_err;
+ l_err = NULL;
+ }
+ else
+ {
+ l_lidInPnor = true;
+ }
+ }
+ return l_lidInPnor;
+
+} \ No newline at end of file
OpenPOWER on IntegriCloud