diff options
Diffstat (limited to 'src')
33 files changed, 232 insertions, 148 deletions
diff --git a/src/include/usr/runtime/customize_attrs_for_payload.H b/src/include/usr/runtime/customize_attrs_for_payload.H index a5158f996..6d6928bda 100644 --- a/src/include/usr/runtime/customize_attrs_for_payload.H +++ b/src/include/usr/runtime/customize_attrs_for_payload.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -33,7 +33,7 @@ */ #include <errl/errlentry.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/attributes.H> namespace RUNTIME @@ -42,7 +42,7 @@ namespace RUNTIME static const TARGETING::ATTR_HBRT_HYP_ID_type HBRT_HYP_ID_UNKNOWN = 0xFFFFFFFFFFFFFFFFULL; -static const RT_TARG::rtChipId_t RT_TYPE_UNKNOWN +static const TARGETING::rtChipId_t RT_TYPE_UNKNOWN = 0xFFFFFFFFFFFFFFFFULL; /** diff --git a/src/include/usr/targeting/common/hbrt_target.H b/src/include/usr/targeting/common/hbrt_target.H new file mode 100644 index 000000000..1a6989bf4 --- /dev/null +++ b/src/include/usr/targeting/common/hbrt_target.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/targeting/common/hbrt_target.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019,2020 */ +/* [+] 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 */ +#ifndef __HBRT_TARGET_H +#define __HBRT_TARGET_H + +#include <errl/errlentry.H> + +namespace TARGETING +{ + typedef uint64_t rtChipId_t; + /** + * @brief Convert a TARGETING::Target to an unit ID that can be used + * in calls to the runtime host + * @param[in] The HB TARGETING::Target + * @param[out] Sapphire target id + * @return an error handle on error + */ + errlHndl_t getRtTarget(const TARGETING::Target* i_target, + rtChipId_t &o_targetId); + +} + +#endif
\ No newline at end of file diff --git a/src/include/usr/runtime/rt_targeting.H b/src/include/usr/targeting/runtime/rt_targeting.H index 9070dbc88..c94b871a9 100644 --- a/src/include/usr/runtime/rt_targeting.H +++ b/src/include/usr/targeting/runtime/rt_targeting.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/include/usr/runtime/rt_targeting.H $ */ +/* $Source: src/include/usr/targeting/runtime/rt_targeting.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -26,6 +26,7 @@ #define __RT_TARGETING_H #include <errl/errlentry.H> +#include <targeting/common/hbrt_target.H> namespace TARGETING { @@ -34,7 +35,6 @@ namespace TARGETING namespace RT_TARG { - typedef uint64_t rtChipId_t; enum { @@ -43,15 +43,6 @@ namespace RT_TARG }; - /** - * @brief Convert a TARGETING::Target to an unit ID that can be used - * in calls to the runtime host - * @param[in] The HB TARGETING::Target - * @param[out] Sapphire target id - * @return an error handle on error - */ - errlHndl_t getRtTarget(const TARGETING::Target* i_target, - rtChipId_t &o_targetId); /** * @brief Convert a runtime chip_id (target) into a TARGETING::Target @@ -59,7 +50,7 @@ namespace RT_TARG * @param[out] The TARGETING::Target pointer * @return error log handle on error else NULL */ - errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id, + errlHndl_t getHbTarget(TARGETING::rtChipId_t i_rt_chip_id, TARGETING::Target *& o_target); /** diff --git a/src/usr/diag/attn/runtime/attn_rt.C b/src/usr/diag/attn/runtime/attn_rt.C index 810e79bbe..92b225c7d 100644 --- a/src/usr/diag/attn/runtime/attn_rt.C +++ b/src/usr/diag/attn/runtime/attn_rt.C @@ -28,7 +28,7 @@ #include "common/attnmem.H" #include "common/attnbits.H" #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/target.H> #include <targeting/common/targetservice.H> #include <targeting/common/utilFilter.H> diff --git a/src/usr/diag/attn/runtime/test/attntestRtAttns.H b/src/usr/diag/attn/runtime/test/attntestRtAttns.H index 6e22b094e..b2bd1fd8e 100644 --- a/src/usr/diag/attn/runtime/test/attntestRtAttns.H +++ b/src/usr/diag/attn/runtime/test/attntestRtAttns.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -38,7 +38,7 @@ #include "../../common/attntrace.H" #include "../../common/attntarget.H" #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/targetservice.H> using namespace ATTN; @@ -79,8 +79,8 @@ class AttnCheckForRtAttentionsTest : public CxxTest::TestSuite } proc = procList[0]; - RT_TARG::rtChipId_t chipId = 0; - errlHndl_t err = RT_TARG::getRtTarget( proc, chipId ); + TARGETING::rtChipId_t chipId = 0; + errlHndl_t err = TARGETING::getRtTarget( proc, chipId ); if( NULL != err ) { TS_FAIL("getRtTarget() failed for 0x%08X", @@ -153,7 +153,7 @@ class AttnCheckForRtAttentionsTest : public CxxTest::TestSuite break; } - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; errlHndl_t err = RT_TARG::getRtTarget( proc, chipId ); if( NULL != err ) { diff --git a/src/usr/fsi/runtime/rt_fsi.C b/src/usr/fsi/runtime/rt_fsi.C index 75103cc4b..551ef7b4e 100644 --- a/src/usr/fsi/runtime/rt_fsi.C +++ b/src/usr/fsi/runtime/rt_fsi.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include <stdlib.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #include <targeting/common/targetservice.H> diff --git a/src/usr/htmgt/runtime/rt_occ.C b/src/usr/htmgt/runtime/rt_occ.C index 652e767ed..d25d12f96 100644 --- a/src/usr/htmgt/runtime/rt_occ.C +++ b/src/usr/htmgt/runtime/rt_occ.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -27,7 +27,7 @@ #include <htmgt/htmgt.H> #include "../htmgt_utility.H" #include <targeting/common/commontargeting.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> using namespace TARGETING; diff --git a/src/usr/i2c/runtime/rt_eepromCache.C b/src/usr/i2c/runtime/rt_eepromCache.C index e3b757b03..2b775ddb5 100644 --- a/src/usr/i2c/runtime/rt_eepromCache.C +++ b/src/usr/i2c/runtime/rt_eepromCache.C @@ -37,7 +37,7 @@ #include <devicefw/driverif.H> #include <i2c/eepromddreasoncodes.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/utilFilter.H> #include <targeting/attrrp.H> #include <trace/interface.H> diff --git a/src/usr/i2c/runtime/rt_i2c.C b/src/usr/i2c/runtime/rt_i2c.C index 16f62c76e..d3f5537c6 100755 --- a/src/usr/i2c/runtime/rt_i2c.C +++ b/src/usr/i2c/runtime/rt_i2c.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2019 */ +/* Contributors Listed Below - COPYRIGHT 2015,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,7 +41,7 @@ #include <devicefw/driverif.H> #include <i2c/i2creasoncodes.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include "../errlud_i2c.H" // ---------------------------------------------- @@ -146,10 +146,10 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType, int rc = 0; bool l_host_if_enabled = true; - RT_TARG::rtChipId_t proc_id = 0; + TARGETING::rtChipId_t proc_id = 0; // Convert target to proc id - err = RT_TARG::getRtTarget( i_target, + err = TARGETING::getRtTarget( i_target, proc_id); if(err) { diff --git a/src/usr/isteps/nvdimm/nvdimm.C b/src/usr/isteps/nvdimm/nvdimm.C index a7e263cf3..e93271e5e 100644 --- a/src/usr/isteps/nvdimm/nvdimm.C +++ b/src/usr/isteps/nvdimm/nvdimm.C @@ -50,7 +50,7 @@ #include <targeting/common/targetUtil.H> #ifdef __HOSTBOOT_RUNTIME #include <runtime/hbrt_utilities.H> -#include <usr/runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #else #include <initservice/istepdispatcherif.H> #endif @@ -3802,9 +3802,9 @@ errlHndl_t notifyNvdimmProtectionChange(Target* i_target, // Send combined status notification // Get the Proc Chip Id - RT_TARG::rtChipId_t l_chipId = 0; + TARGETING::rtChipId_t l_chipId = 0; - l_err = RT_TARG::getRtTarget(l_proc, l_chipId); + l_err = TARGETING::getRtTarget(l_proc, l_chipId); if(l_err) { TRACFCOMP( g_trac_nvdimm, diff --git a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C index f22c7d33a..e8ad1d9e9 100644 --- a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C +++ b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C @@ -43,7 +43,7 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/util.H> #include <targeting/common/utilFilter.H> -#include <usr/runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #include <arch/ppc.H> #include <isteps/nvdimm/nvdimmreasoncodes.H> diff --git a/src/usr/isteps/pm/runtime/rt_pm.C b/src/usr/isteps/pm/runtime/rt_pm.C index 7ee9e0924..58930bc67 100644 --- a/src/usr/isteps/pm/runtime/rt_pm.C +++ b/src/usr/isteps/pm/runtime/rt_pm.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2019 */ +/* Contributors Listed Below - COPYRIGHT 2016,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,7 +37,6 @@ #include <runtime/interface.h> // g_hostInterfaces #include <runtime/rt_fwreq_helper.H> // firmware_request_helper -#include <runtime/rt_targeting.H> #include <runtime/runtime_reasoncodes.H> #include <initservice/isteps_trace.H> @@ -46,6 +45,7 @@ #include <targeting/common/util.H> #include <targeting/common/utilFilter.H> #include <targeting/common/targetservice.H> +#include <targeting/runtime/rt_targeting.H> #include <scom/scomif.H> #include <scom/wakeup.H> @@ -400,9 +400,9 @@ namespace RTPM } // Get the Proc Chip Id - RT_TARG::rtChipId_t l_chipId = 0; + TARGETING::rtChipId_t l_chipId = 0; - l_err = RT_TARG::getRtTarget(l_pChipTarget, l_chipId); + l_err = TARGETING::getRtTarget(l_pChipTarget, l_chipId); if(l_err) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, diff --git a/src/usr/isteps/pm/runtime/test/pmtestRt.H b/src/usr/isteps/pm/runtime/test/pmtestRt.H index 1c29f7ab8..235cb8cec 100644 --- a/src/usr/isteps/pm/runtime/test/pmtestRt.H +++ b/src/usr/isteps/pm/runtime/test/pmtestRt.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* Contributors Listed Below - COPYRIGHT 2017,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -33,7 +33,7 @@ #include <cxxtest/TestSuite.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/utilFilter.H> #include <errl/errlmanager.H> #include <devicefw/userif.H> diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C index c8fb34599..0d40a60c3 100644 --- a/src/usr/pnor/runtime/rt_pnor.C +++ b/src/usr/pnor/runtime/rt_pnor.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2019 */ +/* Contributors Listed Below - COPYRIGHT 2014,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -29,7 +29,7 @@ #include <initservice/taskargs.H> #include <initservice/initserviceif.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> // g_hostInterfaces, postInitCalls_t #include <pnor/pnorif.H> @@ -923,7 +923,7 @@ errlHndl_t RtPnor::getMasterProcId() TRACFCOMP(g_trac_pnor, "RtPnor::getMasterProcId: queryMasterProcChipTargetHandle failed"); break; } - l_err = RT_TARG::getRtTarget(l_masterProc, iv_masterProcId); + l_err = TARGETING::getRtTarget(l_masterProc, iv_masterProcId); if (l_err) { TRACFCOMP(g_trac_pnor, "RtPnor::getMasterProcId: getRtTarget failed for master proc"); diff --git a/src/usr/runtime/customize_attrs_for_payload.C b/src/usr/runtime/customize_attrs_for_payload.C index 69dfc3dfb..273596b12 100644 --- a/src/usr/runtime/customize_attrs_for_payload.C +++ b/src/usr/runtime/customize_attrs_for_payload.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* Contributors Listed Below - COPYRIGHT 2012,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,10 +36,10 @@ #include <targeting/common/target.H> #include <targeting/common/targetservice.H> #include <targeting/common/utilFilter.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/runtime_reasoncodes.H> #include <runtime/runtime.H> #include <errl/errlmanager.H> -#include <runtime/rt_targeting.H> #include <arch/pirformat.H> #include <targeting/common/util.H> #include <errl/errludtarget.H> @@ -110,7 +110,7 @@ errlHndl_t createProcNotFoundError( */ errlHndl_t computeNonPhypRtTarget( const TARGETING::Target* i_pTarget, - RT_TARG::rtChipId_t& o_rtTargetId) + TARGETING::rtChipId_t& o_rtTargetId) { assert(i_pTarget != NULL); @@ -354,7 +354,7 @@ errlHndl_t computeNonPhypRtTarget( */ errlHndl_t getRtTypeForTarget( const TARGETING::Target* i_pTarget, - RT_TARG::rtChipId_t& o_rtType) + TARGETING::rtChipId_t& o_rtType) { assert(i_pTarget != NULL); diff --git a/src/usr/sbeio/runtime/rt_sbeio.C b/src/usr/sbeio/runtime/rt_sbeio.C index 360a144cd..1c95596a5 100644 --- a/src/usr/sbeio/runtime/rt_sbeio.C +++ b/src/usr/sbeio/runtime/rt_sbeio.C @@ -41,7 +41,7 @@ #include <targeting/common/target.H> #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> using namespace TARGETING; diff --git a/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H b/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H index d99acfe8b..5c58078c5 100644 --- a/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H +++ b/src/usr/sbeio/runtime/test/sbeioAttrOverrideTests.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ +/* Contributors Listed Below - COPYRIGHT 2017,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -27,7 +27,6 @@ #include <cxxtest/TestSuite.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> #include <sbeio/runtime/sbe_msg_passing.H> #include <sbeio/sbeioreasoncodes.H> #include <secureboot/service.H> @@ -35,6 +34,7 @@ #include <targeting/common/target.H> #include <targeting/common/targetservice.H> #include <targeting/common/utilFilter.H> +#include <targeting/runtime/rt_targeting.H> #include <errl/errlmanager.H> #include <devicefw/userif.H> @@ -173,8 +173,8 @@ public: } l_proc = procList[0]; - RT_TARG::rtChipId_t l_chipId = 0; - errlHndl_t l_err = RT_TARG::getRtTarget(l_proc, l_chipId); + TARGETING::rtChipId_t l_chipId = 0; + errlHndl_t l_err = TARGETING::getRtTarget(l_proc, l_chipId); if(nullptr != l_err) { diff --git a/src/usr/sbeio/runtime/test/sbeiotestRt.H b/src/usr/sbeio/runtime/test/sbeiotestRt.H index a2a4b1996..c91a663bb 100644 --- a/src/usr/sbeio/runtime/test/sbeiotestRt.H +++ b/src/usr/sbeio/runtime/test/sbeiotestRt.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* Contributors Listed Below - COPYRIGHT 2017,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -35,7 +35,7 @@ #include <runtime/interface.h> #include <sbeio/runtime/sbe_msg_passing.H> #include <sbeio/sbeioreasoncodes.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/attributes.H> #include <targeting/common/utilFilter.H> #include <errl/errlmanager.H> @@ -88,7 +88,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite */ int initSbeMessagePassing(sbeMessage_t& o_request, sbeMessage_t& o_expected_response, - RT_TARG::rtChipId_t& o_chipId, + TARGETING::rtChipId_t& o_chipId, uint64_t& o_sbeCommAddr, runtimeInterfaces_t **o_rt_intf) { @@ -142,8 +142,8 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite TargetHandle_t proc = procList[0]; // Get the chip ID for the proc - RT_TARG::rtChipId_t o_chipId = 0; - errlHndl_t err = RT_TARG::getRtTarget(proc, o_chipId); + TARGETING::rtChipId_t o_chipId = 0; + errlHndl_t err = TARGETING::getRtTarget(proc, o_chipId); if(nullptr != err) { rc = -1; @@ -311,7 +311,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite * * @return Return Code O if Successful, otherwise not 0. */ - int checkResetSbeMessagePassingCFAM(RT_TARG::rtChipId_t i_procChipId, + int checkResetSbeMessagePassingCFAM(TARGETING::rtChipId_t i_procChipId, uint32_t i_checkMask = SBE_MSG_MASK) { // Test check / reset CFAM entry @@ -402,7 +402,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite "testSbeMessagePassingVersions"); sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -501,7 +501,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -567,7 +567,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -741,7 +741,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -832,7 +832,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -984,7 +984,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; @@ -1142,7 +1142,7 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite sbeMessage_t l_request; sbeMessage_t l_expected_response; uint32_t l_hdrsSize = sizeof(sbeHeader_t) + sizeof(cmdHeader_t); - RT_TARG::rtChipId_t chipId = 0; + TARGETING::rtChipId_t chipId = 0; uint64_t l_sbeCommAddr = 0; runtimeInterfaces_t *rt_intf = nullptr; diff --git a/src/usr/scom/handleSpecialWakeup.C b/src/usr/scom/handleSpecialWakeup.C index 07bab3a1b..e202e9bdb 100644 --- a/src/usr/scom/handleSpecialWakeup.C +++ b/src/usr/scom/handleSpecialWakeup.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,7 +37,7 @@ #include <initservice/initserviceif.H> #ifdef __HOSTBOOT_RUNTIME -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #endif // __HOSTBOOT_RUNTIME @@ -156,8 +156,8 @@ errlHndl_t callWakeupHyp(TARGETING::Target* i_target, ++pCore_it ) { // Runtime target id - RT_TARG::rtChipId_t rtTargetId = 0; - l_errl = RT_TARG::getRtTarget(*pCore_it, rtTargetId); + TARGETING::rtChipId_t rtTargetId = 0; + l_errl = TARGETING::getRtTarget(*pCore_it, rtTargetId); if(l_errl) { break; diff --git a/src/usr/scom/runtime/rt_scom.C b/src/usr/scom/runtime/rt_scom.C index eafc14790..4507b435f 100644 --- a/src/usr/scom/runtime/rt_scom.C +++ b/src/usr/scom/runtime/rt_scom.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2019 */ +/* Contributors Listed Below - COPYRIGHT 2013,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -30,7 +30,7 @@ #include <scom/scomif.H> #include <scom/runtime/rt_scomif.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <xscom/piberror.H> #include <runtime/hbrt_utilities.H> @@ -169,8 +169,8 @@ errlHndl_t sendScomToHyp(DeviceFW::OperationType i_opType, do { // Convert target to something Sapphire understands - RT_TARG::rtChipId_t target_id = 0; - l_err = RT_TARG::getRtTarget(i_target, + TARGETING::rtChipId_t target_id = 0; + l_err = TARGETING::getRtTarget(i_target, target_id); if(l_err) { diff --git a/src/usr/secureboot/runtime/rt_secureboot.C b/src/usr/secureboot/runtime/rt_secureboot.C index b1da0f878..c1608fa73 100644 --- a/src/usr/secureboot/runtime/rt_secureboot.C +++ b/src/usr/secureboot/runtime/rt_secureboot.C @@ -35,7 +35,7 @@ #include <secureboot/secure_reasoncodes.H> #include <errl/errlmanager.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/commontargeting.H> #include <targeting/common/targetservice.H> #include <devicefw/userif.H> diff --git a/src/usr/secureboot/runtime/test/testsecureboot_rt.H b/src/usr/secureboot/runtime/test/testsecureboot_rt.H index c15214759..5a690d3fa 100644 --- a/src/usr/secureboot/runtime/test/testsecureboot_rt.H +++ b/src/usr/secureboot/runtime/test/testsecureboot_rt.H @@ -34,7 +34,7 @@ #include <cxxtest/TestSuite.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <errl/errlmanager.H> #include <devicefw/userif.H> diff --git a/src/usr/targeting/common/common.mk b/src/usr/targeting/common/common.mk index 5c357f111..951aa8663 100644 --- a/src/usr/targeting/common/common.mk +++ b/src/usr/targeting/common/common.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2011,2018 +# Contributors Listed Below - COPYRIGHT 2011,2020 # [+] International Business Machines Corp. # # @@ -64,4 +64,3 @@ COMMON_TARGETING_OBJS += ${TARGET_OBJS} COMMON_TARGETING_OBJS += ${PREDICATES_OBJS} COMMON_TARGETING_OBJS += ${ITERATORS_OBJS} COMMON_TARGETING_OBJS += ${OTHER_OBJS} - diff --git a/src/usr/targeting/common/hbrt_target.C b/src/usr/targeting/common/hbrt_target.C new file mode 100644 index 000000000..b91979922 --- /dev/null +++ b/src/usr/targeting/common/hbrt_target.C @@ -0,0 +1,101 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/targeting/common/hbrt_target.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019,2020 */ +/* [+] 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 <targeting/common/hbrt_target.H> +#include <targeting/common/targetservice.H> +#include <targeting/common/targreasoncodes.H> +#include <runtime/customize_attrs_for_payload.H> +#include <targeting/common/trace.H> +#ifdef __HOSTBOOT_MODULE +#include <errl/errludtarget.H> +#endif + +extern trace_desc_t* g_trac_hbrt; +using namespace TARGETING; + +namespace TARGETING +{ + +errlHndl_t getRtTarget( + const TARGETING::Target* i_pTarget, + rtChipId_t& o_rtTargetId) +{ + errlHndl_t pError = NULL; + + do + { + if(i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) + { + TARGETING::Target* masterProcChip = NULL; + TARGETING::targetService(). + masterProcChipTargetHandle(masterProcChip); + i_pTarget = masterProcChip; + } + + auto hbrtHypId = RUNTIME::HBRT_HYP_ID_UNKNOWN; + if( (!i_pTarget->tryGetAttr<TARGETING::ATTR_HBRT_HYP_ID>(hbrtHypId)) + || (hbrtHypId == RUNTIME::HBRT_HYP_ID_UNKNOWN)) + { + auto huid = get_huid(i_pTarget); + auto targetingTargetType = + i_pTarget->getAttr<TARGETING::ATTR_TYPE>(); + TRACFCOMP(g_trac_targeting, ERR_MRK + "Targeting target type of 0x%08X not supported. " + "HUID: 0x%08X", + targetingTargetType, + huid); + /*@ + * @errortype + * @moduleid TARG_RT_GET_RT_TARGET + * @reasoncode TARG_RT_TARGET_TYPE_NOT_SUPPORTED + * @userdata1 Target's HUID + * @userdata2 target's targeting type + * @devdesc Targeting target's type not supported by runtime + * code + */ + pError = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + TARGETING::TARG_RT_GET_RT_TARGET, + TARGETING::TARG_RT_TARGET_TYPE_NOT_SUPPORTED, + huid, + targetingTargetType +#ifdef __HOSTBOOT_MODULE + ,true); + + ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target"). + addToLog(pError); +#else + ); // if not in hostboot code then skip last param of error log + // and do not create a user details section +#endif + } + + o_rtTargetId = hbrtHypId; + + } while(0); + + return pError; +} + +}
\ No newline at end of file diff --git a/src/usr/targeting/hostboot_common.mk b/src/usr/targeting/hostboot_common.mk index 7be1449d7..4d10df929 100644 --- a/src/usr/targeting/hostboot_common.mk +++ b/src/usr/targeting/hostboot_common.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2016 +# Contributors Listed Below - COPYRIGHT 2013,2020 # [+] International Business Machines Corp. # # @@ -30,6 +30,9 @@ COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_REL_PATH}/common.mk include ${COMMON_TARGETING_MAKEFILE} +# TODO: 248022 move this to common.mk when CMVC files are updated for fips +TARGET_OBJS += hbrt_target.o + VPATH += ${TARGETING_REL_PATH}/adapters VPATH += ${COMMON_TARGETING_REL_PATH} VPATH += ${addprefix ${COMMON_TARGETING_REL_PATH}/, ${COMMON_TARGETING_SUBDIRS}} diff --git a/src/usr/targeting/makefile b/src/usr/targeting/makefile index 56f29e51d..af1978f64 100644 --- a/src/usr/targeting/makefile +++ b/src/usr/targeting/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2011,2019 +# Contributors Listed Below - COPYRIGHT 2011,2020 # [+] International Business Machines Corp. # # diff --git a/src/usr/targeting/runtime/attrPlatOverride_rt.C b/src/usr/targeting/runtime/attrPlatOverride_rt.C index 752fa740a..3c805381c 100644 --- a/src/usr/targeting/runtime/attrPlatOverride_rt.C +++ b/src/usr/targeting/runtime/attrPlatOverride_rt.C @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <targeting/common/commontargeting.H> #include <targeting/attrPlatOverride.H> #include <fapi2/plat_attr_override_sync.H> diff --git a/src/usr/targeting/runtime/makefile b/src/usr/targeting/runtime/makefile index 9d872cef7..eb1dd366e 100644 --- a/src/usr/targeting/runtime/makefile +++ b/src/usr/targeting/runtime/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2019 +# Contributors Listed Below - COPYRIGHT 2013,2020 # [+] International Business Machines Corp. # # diff --git a/src/usr/targeting/runtime/rt_startup.C b/src/usr/targeting/runtime/rt_startup.C index 578750006..ed190f196 100644 --- a/src/usr/targeting/runtime/rt_startup.C +++ b/src/usr/targeting/runtime/rt_startup.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #include <targeting/common/target.H> #include <targeting/common/targetservice.H> diff --git a/src/usr/targeting/runtime/rt_targeting.C b/src/usr/targeting/runtime/rt_targeting.C index 581386985..28c1fdf7d 100644 --- a/src/usr/targeting/runtime/rt_targeting.C +++ b/src/usr/targeting/runtime/rt_targeting.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,7 +39,7 @@ #include <targeting/attrrp.H> #include <arch/pirformat.H> #include <runtime/customize_attrs_for_payload.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #include <map> #include <util/memoize.H> @@ -54,61 +54,6 @@ using namespace TARGETING; namespace RT_TARG { -errlHndl_t getRtTarget( - const TARGETING::Target* i_pTarget, - rtChipId_t& o_rtTargetId) -{ - errlHndl_t pError = NULL; - - do - { - if(i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) - { - TARGETING::Target* masterProcChip = NULL; - TARGETING::targetService(). - masterProcChipTargetHandle(masterProcChip); - i_pTarget = masterProcChip; - } - - auto hbrtHypId = RUNTIME::HBRT_HYP_ID_UNKNOWN; - if( (!i_pTarget->tryGetAttr<TARGETING::ATTR_HBRT_HYP_ID>(hbrtHypId)) - || (hbrtHypId == RUNTIME::HBRT_HYP_ID_UNKNOWN)) - { - auto huid = get_huid(i_pTarget); - auto targetingTargetType = - i_pTarget->getAttr<TARGETING::ATTR_TYPE>(); - TRACFCOMP(g_trac_targeting, ERR_MRK - "Targeting target type of 0x%08X not supported. " - "HUID: 0x%08X", - targetingTargetType, - huid); - /*@ - * @errortype - * @moduleid TARG_RT_GET_RT_TARGET - * @reasoncode TARG_RT_TARGET_TYPE_NOT_SUPPORTED - * @userdata1 Target's HUID - * @userdata2 target's targeting type - * @devdesc Targeting target's type not supported by runtime - * code - */ - pError = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - TARGETING::TARG_RT_GET_RT_TARGET, - TARGETING::TARG_RT_TARGET_TYPE_NOT_SUPPORTED, - huid, - targetingTargetType, - true); - - ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target"). - addToLog(pError); - } - - o_rtTargetId = hbrtHypId; - - } while(0); - - return pError; -} /** * @brief API documentation same as for getHbTarget; this just implements the diff --git a/src/usr/targeting/runtime/test/testtargeting.H b/src/usr/targeting/runtime/test/testtargeting.H index 5dbd3f15e..c6c7c0d60 100644 --- a/src/usr/targeting/runtime/test/testtargeting.H +++ b/src/usr/targeting/runtime/test/testtargeting.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2019 */ +/* Contributors Listed Below - COPYRIGHT 2013,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,7 @@ #include <cxxtest/TestSuite.H> #include <targeting/common/commontargeting.H> #include <runtime/interface.h> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <errl/errlentry.H> #include <errl/errlmanager.H> #include <targeting/common/trace.H> @@ -62,7 +62,7 @@ class TargetingTestSuite : public CxxTest::TestSuite { using namespace TARGETING; errlHndl_t err = NULL; - RT_TARG::rtChipId_t rt_chipid; + TARGETING::rtChipId_t rt_chipid; TARGETING::TargetHandleList allTargets; TARGETING::TargetHandleList targetList; @@ -91,7 +91,7 @@ class TargetingTestSuite : public CxxTest::TestSuite for(TargetHandleList::iterator pTarg = allTargets.begin(); pTarg != allTargets.end(); ++pTarg) { - err = RT_TARG::getRtTarget(*pTarg, rt_chipid); + err = TARGETING::getRtTarget(*pTarg, rt_chipid); if( err ) { TS_FAIL("getRtTarget returned error log"); diff --git a/src/usr/util/runtime/rt_fwnotify.C b/src/usr/util/runtime/rt_fwnotify.C index 148d3bbeb..556a1c31f 100644 --- a/src/usr/util/runtime/rt_fwnotify.C +++ b/src/usr/util/runtime/rt_fwnotify.C @@ -31,7 +31,7 @@ #include <errl/errlmanager.H> // errlCommit #include <errl/hberrltypes.H> // TWO_UINT32_TO_UINT64 #include <targeting/common/target.H> // TargetHandle_t, getTargetFromHuid -#include <runtime/rt_targeting.H> // RT_TARG::getHbTarget +#include <targeting/runtime/rt_targeting.H> // RT_TARG::getHbTarget #include <attributeenums.H> // ATTRIBUTE_ID #ifdef CONFIG_NVDIMM diff --git a/src/usr/vpd/runtime/rt_vpd.C b/src/usr/vpd/runtime/rt_vpd.C index ba0335484..ee7fa9f7b 100644 --- a/src/usr/vpd/runtime/rt_vpd.C +++ b/src/usr/vpd/runtime/rt_vpd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,7 +34,7 @@ #include <util/runtime/rt_fwreq_helper.H> // firmware_request_helper #include <targeting/common/util.H> #include <util/runtime/util_rt.H> -#include <runtime/rt_targeting.H> +#include <targeting/runtime/rt_targeting.H> #include <runtime/interface.h> #include <initservice/initserviceif.H> |