本文整理汇总了C++中fapi::Target::get方法的典型用法代码示例。如果您正苦于以下问题:C++ Target::get方法的具体用法?C++ Target::get怎么用?C++ Target::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fapi::Target
的用法示例。
在下文中一共展示了Target::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fapiGetOtherSideOfMemChannel
//******************************************************************************
// fapiGetOtherSideOfMemChannel function
//******************************************************************************
fapi::ReturnCode fapiGetOtherSideOfMemChannel(
const fapi::Target& i_target,
fapi::Target & o_target,
const fapi::TargetState i_state)
{
fapi::ReturnCode l_rc;
TargetHandleList l_targetList;
FAPI_DBG(ENTER_MRK "fapiGetOtherSideOfMemChannel. State: 0x%08x",
i_state);
TargetHandle_t l_target =
reinterpret_cast<TargetHandle_t>(i_target.get());
if (l_target == NULL)
{
FAPI_ERR("fapiGetOtherSideOfMemChannel. Embedded NULL target pointer");
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
* @reasoncode fapi::RC_EMBEDDED_NULL_TARGET_PTR
* @devdesc Target has embedded null target pointer
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
fapi::RC_EMBEDDED_NULL_TARGET_PTR,
0, 0, hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else if (i_target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET)
{
// find the Centaur that is associated with this MCS
getChildAffinityTargets(l_targetList, l_target,
CLASS_CHIP, TYPE_MEMBUF, false);
if(l_targetList.size() != 1) // one and only one expected
{
FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 Centaur %d",
l_targetList.size());
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
* @reasoncode fapi::RC_NO_SINGLE_MEMBUFF
* @userdata1 Number of Memory Buffers
* @userdata2 MCS HUID
* @devdesc fapiGetOtherSideOfMemChannel could not find exactly
* one target on the other side of the correct state
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
fapi::RC_NO_SINGLE_MEMBUFF,
l_targetList.size(),
TARGETING::get_huid(l_target),
hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
o_target.setType(fapi::TARGET_TYPE_MEMBUF_CHIP);
o_target.set(reinterpret_cast<void *>(l_targetList[0]));
}
}
else if (i_target.getType() == fapi::TARGET_TYPE_MEMBUF_CHIP)
{
// find the MCS that is associated with this Centaur
getParentAffinityTargets (l_targetList, l_target,
CLASS_UNIT, TYPE_MCS, false);
if(l_targetList.size() != 1) // one and only one expected
{
FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 MCS %d",
l_targetList.size());
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
* @reasoncode fapi::RC_NO_SINGLE_MCS
* @userdata1 Number of MCSs
* @userdata2 Membuf HUID
* @devdesc fapiGetOtherSideOfMemChannel could not find exactly
* one target on the other side of the correct state
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
fapi::RC_NO_SINGLE_MCS,
l_targetList.size(),
//.........这里部分代码省略.........
示例2: fapiGetParentChip
//******************************************************************************
// fapiGetParentChip function
//******************************************************************************
fapi::ReturnCode fapiGetParentChip(
const fapi::Target& i_chiplet,
fapi::Target & o_chip)
{
FAPI_DBG(ENTER_MRK "fapiGetParentChip");
fapi::ReturnCode l_rc;
// Extract the HostBoot Target pointer for the input chiplet
TARGETING::Target * l_pChiplet =
reinterpret_cast<TARGETING::Target*>(i_chiplet.get());
// Check that the input target is a chiplet
if (!i_chiplet.isChiplet())
{
FAPI_ERR("fapiGetParentChip. Input target type 0x%08x is not a chiplet",
i_chiplet.getType());
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP
* @reasoncode fapi::RC_INVALID_REQUEST
* @userdata1 Type of input target
* @userdata2 Input Target HUID
* @devdesc fapiGetParentChip request for non-chiplet
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_PARENT_CHIP,
fapi::RC_INVALID_REQUEST,
i_chiplet.getType(),
TARGETING::get_huid(l_pChiplet),
hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
if (l_pChiplet == NULL)
{
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP
* @reasoncode fapi::RC_EMBEDDED_NULL_TARGET_PTR
* @devdesc Target has embedded null target pointer
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_PARENT_CHIP,
fapi::RC_EMBEDDED_NULL_TARGET_PTR,
0, 0, hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
const TARGETING::Target * l_pChip =
TARGETING::getParentChip(l_pChiplet);
if (l_pChip == NULL)
{
FAPI_ERR("fapiGetParentChip. Parent not found");
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP
* @reasoncode fapi::RC_NO_SINGLE_PARENT
* @userdata1 Input Chiplet Target HUID
* @devdesc fapiGetParentChip did not find one parent
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_PARENT_CHIP,
fapi::RC_NO_SINGLE_PARENT,
TARGETING::get_huid(l_pChiplet),
0, hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
// Set the output chip type
if (l_pChip->getAttr<TARGETING::ATTR_TYPE>() ==
TARGETING::TYPE_PROC)
{
o_chip.setType(fapi::TARGET_TYPE_PROC_CHIP);
}
else
{
o_chip.setType(fapi::TARGET_TYPE_MEMBUF_CHIP);
}
//.........这里部分代码省略.........
示例3: fapiGetChildChiplets
//******************************************************************************
// fapiGetChildChiplets function
//******************************************************************************
fapi::ReturnCode fapiGetChildChiplets(
const fapi::Target & i_chip,
const fapi::TargetType i_chipletType,
std::vector<fapi::Target> & o_chiplets,
const fapi::TargetState i_state)
{
FAPI_DBG(ENTER_MRK "fapiGetChildChiplets. Chiplet Type:0x%08x State:0x%08x",
i_chipletType, i_state);
fapi::ReturnCode l_rc;
o_chiplets.clear();
// Extract the HostBoot Target pointer for the input chip
TARGETING::Target * l_pChip =
reinterpret_cast<TARGETING::Target*>(i_chip.get());
// Check that the input target is a chip
if (!i_chip.isChip())
{
FAPI_ERR("fapiGetChildChiplets. Input target type 0x%08x is not a chip",
i_chip.getType());
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_CHILD_CHIPLETS
* @reasoncode fapi::RC_INVALID_REQUEST
* @userdata1 Type of input target
* @userdata2 Input Target HUID
* @devdesc fapiGetChildChiplets request for non-chip
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_CHILD_CHIPLETS,
fapi::RC_INVALID_REQUEST,
i_chip.getType(),
TARGETING::get_huid(l_pChip),
hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
TARGETING::TYPE l_type = TARGETING::TYPE_NA;
if (i_chipletType == fapi::TARGET_TYPE_EX_CHIPLET)
{
l_type = TARGETING::TYPE_EX;
}
else if (i_chipletType == fapi::TARGET_TYPE_MBA_CHIPLET)
{
l_type = TARGETING::TYPE_MBA;
}
else if (i_chipletType == fapi::TARGET_TYPE_MCS_CHIPLET)
{
l_type = TARGETING::TYPE_MCS;
}
else if (i_chipletType == fapi::TARGET_TYPE_XBUS_ENDPOINT)
{
l_type = TARGETING::TYPE_XBUS;
}
else if (i_chipletType == fapi::TARGET_TYPE_ABUS_ENDPOINT)
{
l_type = TARGETING::TYPE_ABUS;
}
else if (i_chipletType == fapi::TARGET_TYPE_L4)
{
l_type = TARGETING::TYPE_L4;
}
else
{
FAPI_ERR("fapiGetChildChiplets. Chiplet type 0x%08x not supported",
i_chipletType);
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_CHILD_CHIPLETS
* @reasoncode fapi::RC_UNSUPPORTED_REQUEST
* @userdata1 Type of requested chiplet
* @userdata2 Input Chip Target HUID
* @devdesc fapiGetChildChiplets request for unsupported
* or invalid chiplet type
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_CHILD_CHIPLETS,
fapi::RC_UNSUPPORTED_REQUEST,
i_chipletType,
TARGETING::get_huid(l_pChip),
hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
if (!l_rc)
{
if (l_pChip == NULL)
//.........这里部分代码省略.........
示例4: fapiGetAssociatedDimms
//******************************************************************************
// fapiGetAssociatedDimms function
//******************************************************************************
fapi::ReturnCode fapiGetAssociatedDimms(
const fapi::Target& i_target,
std::vector<fapi::Target> & o_dimms,
const fapi::TargetState i_state)
{
FAPI_DBG(ENTER_MRK "fapiGetAssociatedDimms. State: 0x%08x", i_state);
fapi::ReturnCode l_rc;
o_dimms.clear();
// Extract the HostBoot Target pointer for the input target
TARGETING::Target * l_pTarget =
reinterpret_cast<TARGETING::Target*>(i_target.get());
if (l_pTarget == NULL)
{
FAPI_ERR("fapiGetAssociatedDimms. Embedded NULL target pointer");
/*@
* @errortype
* @moduleid fapi::MOD_FAPI_GET_ASSOCIATE_DIMMS
* @reasoncode fapi::RC_EMBEDDED_NULL_TARGET_PTR
* @devdesc Target has embedded null target pointer
*/
const bool hbSwError = true;
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_FAPI_GET_ASSOCIATE_DIMMS,
fapi::RC_EMBEDDED_NULL_TARGET_PTR,
0, 0, hbSwError);
// Attach the error log to the fapi::ReturnCode
l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
}
else
{
// Get associated dimms
TARGETING::PredicateCTM l_predicate(TARGETING::CLASS_LOGICAL_CARD,
TARGETING::TYPE_DIMM);
TARGETING::TargetHandleList l_dimmList;
TARGETING::targetService().
getAssociated(l_dimmList, l_pTarget,
TARGETING::TargetService::CHILD_BY_AFFINITY,
TARGETING::TargetService::ALL, &l_predicate);
// Return fapi::Targets to the caller
for (TARGETING::TargetHandleList::const_iterator
dimmIter = l_dimmList.begin();
dimmIter != l_dimmList.end();
++dimmIter)
{
TARGETING::HwasState l_state =
(*dimmIter)->getAttr<TARGETING::ATTR_HWAS_STATE>();
if ((fapi::TARGET_STATE_PRESENT == i_state) && !l_state.present)
{
continue;
}
if ((fapi::TARGET_STATE_FUNCTIONAL == i_state) &&
!l_state.functional)
{
continue;
}
fapi::Target l_dimm(fapi::TARGET_TYPE_DIMM,
reinterpret_cast<void *>(*dimmIter));
o_dimms.push_back(l_dimm);
}
}
FAPI_DBG(EXIT_MRK "fapiGetAssociatedDimms. %d results", o_dimms.size());
return l_rc;
}
示例5: fapiSpecialWakeup
//******************************************************************************
// fapiSpecialWakeup
//******************************************************************************
fapi::ReturnCode fapiSpecialWakeup(const fapi::Target & i_target,
const bool i_enable)
{
fapi::ReturnCode fapi_rc = fapi::FAPI_RC_SUCCESS;
FAPI_INF("fapiSpecialWakeup");
#ifdef __HOSTBOOT_RUNTIME
if(!INITSERVICE::spBaseServicesEnabled())
{
TARGETING::Target* l_EXtarget =
reinterpret_cast<TARGETING::Target*>(i_target.get());
errlHndl_t err_SW = handleSpecialWakeup(l_EXtarget,i_enable);
if(err_SW)
{
fapi_rc.setPlatError(reinterpret_cast<void *>(err_SW));
}
}
else if(g_hostInterfaces && g_hostInterfaces->wakeup)
{
TARGETING::Target* target =
reinterpret_cast<TARGETING::Target*>(i_target.get());
RT_TARG::rtChipId_t core_id = 0;
errlHndl_t err = RT_TARG::getRtTarget(target, core_id);
if(err)
{
fapi_rc.setPlatError(reinterpret_cast<void *>(err));
}
else
{
uint32_t mode = 0; //Force awake
if(!i_enable)
{
mode = 1; // clear force
}
int rc = g_hostInterfaces->wakeup(core_id, mode);
if(rc)
{
FAPI_ERR("CPU core wakeup call to hypervisor returned rc = %d",
rc);
/*@
* @errortype
* @moduleid fapi::MOD_PLAT_SPECIAL_WAKEUP
* @reasoncode fapi::RC_RT_WAKEUP_FAILED
* @userdata1 Hypervisor return code
* @userdata2 Chiplet HUID
* @devdesc Error code from hypervisor wakeup call
*/
const bool hbSwError = true;
err = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
fapi::MOD_PLAT_SPECIAL_WAKEUP,
fapi::RC_RT_WAKEUP_FAILED,
rc,
TARGETING::get_huid(target),
hbSwError);
fapi_rc.setPlatError(reinterpret_cast<void*>(err));
}
}
}
#endif
// On Hostboot, processor cores cannot sleep so return success to the
// fapiSpecialWakeup enable/disable calls
return fapi_rc;
}