本文整理汇总了C++中targeting::TargetHandleList类的典型用法代码示例。如果您正苦于以下问题:C++ TargetHandleList类的具体用法?C++ TargetHandleList怎么用?C++ TargetHandleList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TargetHandleList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: call_nvdimm_update
/**
* @brief This function updates the NVDIMM firmware code
*/
void call_nvdimm_update()
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,ENTER_MRK"call_nvdimm_update()");
TARGETING::TargetHandleList l_nvdimmTargetList;
TARGETING::TargetHandleList l_procList;
TARGETING::getAllChips(l_procList, TARGETING::TYPE_PROC, false);
// grab the NVDIMMs under each processor and add to overall list
for (auto l_proc : l_procList)
{
TARGETING::TargetHandleList tmpList =
TARGETING::getProcNVDIMMs(l_proc);
l_nvdimmTargetList.insert(l_nvdimmTargetList.end(),
tmpList.begin(), tmpList.end());
}
// Run the nvdimm update function if the list is not empty
if ( !l_nvdimmTargetList.empty() )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_nvdimm_update(): found %d nvdimms to check for update",
l_nvdimmTargetList.size());
bool updateWorked = NVDIMM::nvdimm_update(l_nvdimmTargetList);
if (!updateWorked)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_nvdimm_update(): nvdimm update failed");
}
}
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,EXIT_MRK"call_nvdimm_update()");
}
示例2: MoveToFrontInTheseChips
//Swaps chip at location 0 with a chip at location i_chipToFront
void FabricDomain::MoveToFrontInTheseChips(uint32_t i_chipToFront, TARGETING::TargetHandleList & i_chips)
{
using namespace TARGETING;
for (TargetHandleList::iterator i = i_chips.begin()+i_chipToFront; i != i_chips.begin(); i--)
{
std::swap((*i), (*(i-1)));
}
}
示例3: AnalyzeTheseChips
//Analyze a subset of chips in a Domain...
//This is a mini analysis of some of the chips in the Fabric Domain.
int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData,
ATTENTION_TYPE attentionType,
TARGETING::TargetHandleList & i_chips)
{
using namespace TARGETING ;
PRDF_DENTER( "FabricDomain::AnalyzeTheseChips" );
int32_t l_rc = ~SUCCESS;
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips:: Domain ID = 0x%X", GetId() );
if(i_chips.size() != 0)
{
for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i)
{
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Before--chip=0x%X",
PlatServices::getHuid(*i));
}
OrderTheseChips(attentionType, i_chips);
for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i)
{
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::After--chip=0x%X",
PlatServices::getHuid(*i) );
}
//After the Order function is called the first chip should contain the chip to look at.
//Look here for the correct LookUp function. I don't think this is working.
RuleChip * l_fabChip = FindChipInTheseChips(i_chips[0], i_chips);
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Analyzing this one: 0x%X",
l_fabChip->GetId() );
if(NULL != l_fabChip)
{
l_rc = l_fabChip->Analyze(serviceData, attentionType);
}
else
{
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::l_fabChip is NULL" );
l_rc = ~SUCCESS;
}
}
else
{
PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::i_chips = %d",
i_chips.size() );
}
//Get P7 chip Global FIR data for FFDC
for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i)
{
RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips);
l_fabChip->CaptureErrorData(
serviceData.service_data->GetCaptureData(),
Util::hashString("GlobalFIRs"));
}
PRDF_DEXIT( "FabricDomain::AnalyzeTheseChips" );
return l_rc;
}
示例4: resetBackupTopology
//*****************************************************************************
// resetBackupTopology
//*****************************************************************************
errlHndl_t resetBackupTopology(
uint32_t i_oscPos,
const TARGETING::TargetHandle_t& i_procOscTgt,
const TARGETING::TargetHandleList& i_badChipList,
bool i_informPhyp)
{
TOD_ENTER("resetBackupTopology");
errlHndl_t l_err = nullptr;
// Put the handle to the firmware_request request struct
// out here so it is easier to free later
hostInterfaces::hbrt_fw_msg *l_req_fw_msg = nullptr;
hostInterfaces::hbrt_fw_msg *l_resp_fw_msg = nullptr;
do
{
if ((nullptr == g_hostInterfaces) ||
(nullptr == g_hostInterfaces->firmware_request))
{
TOD_ERR("resetBackupTopology: "
"Hypervisor firmware_request interface not linked");
/*@
* @errortype
* @severity ERRL_SEV_UNRECOVERABLE
* @moduleid TOD_RT_TOPOLOGY_RESET_BACKUP
* @reasoncode TOD_RT_NULL_FIRMWARE_REQUEST_PTR
* @userdata1 None
* @userdata2 None
* @devdesc Host interfaces are not initialized
* @custdesc An internal error occurred. This will
* force the Time of Day function to run
* with complete redundancy.
*/
l_err = new ErrlEntry( ERRL_SEV_UNRECOVERABLE,
TOD_RT_TOPOLOGY_RESET_BACKUP,
TOD_RT_NULL_FIRMWARE_REQUEST_PTR,
0, 0, true);
break;
}
// The format of the data to be sent, according to the document
// "Handle PRD Request for resetting backup TOD topology" is as follows
// All data members below are 4 bytes long (32 bits)
// Ordinal ID - 0xFFFFFFFF means no OSC to be avoided
// HUID of the node - This field should be considered only if Ordinal
// ID is NOT set to 0xFFFFFFFF otherwise it is set
// to 0
// HUID of the first processor
// HUID of the second processor, etc
// Check if we get conflicting data, if so send a Trace out
if ((0xFFFFFFFF == i_oscPos) && (nullptr != i_procOscTgt))
{
TOD_ERR("Conflicting input data, input oscillator position "
"(i_oscPos) has value 0xFFFFFFFF, meaning no oscillator "
"to be avoided but input oscillator target (i_procOscTgt) "
"has a valid value" );
}
else if ((0xFFFFFFFF != i_oscPos) && (nullptr == i_procOscTgt))
{
TOD_ERR("Conflicting input data, input oscillator position "
"(i_oscPos) has value 0x%X, meaning avoid oscillator "
"but input oscillator target (i_procOscTgt) "
"has a NULL value", i_oscPos);
}
// Flag to determine if the OSC data will be added to the data
bool l_addOscData = (0xFFFFFFFF != i_oscPos) &&
(nullptr != i_procOscTgt);
// Default the request data size to the size of the
// GenericFspMboxMessage_t minus the size of the
// GenericFspMboxMessage_t's data. The size of the
// GenericFspMboxMessage_t's data will be added later
uint32_t l_req_data_size = sizeof(GenericFspMboxMessage_t) -
sizeof(GenericFspMboxMessage_t::data);
// Add to the request data size iff there is data needing to be passed
if (i_badChipList.size() > 0)
{
// if the bad chip list has any items then increase size to
// accommodate for an ordinal ID and a HUID, regardless if
// they have relevant data or not, because they are expected
// before the HUID list.
l_req_data_size += (MSG_OSC_SIZE_OF_DETAILS * sizeof(uint32_t)) +
(i_badChipList.size() * sizeof(uint32_t));
}
else if (l_addOscData)
{
// if there is a valid OSC then accommodate for an ordinal ID
// and HUID of node, but don't need space for HUID list because,
// if we are here, the list is empty
l_req_data_size += (MSG_OSC_SIZE_OF_DETAILS * sizeof(uint32_t));
}
// The request data size must be at a minimum the size of the
//.........这里部分代码省略.........
示例5: OrderTheseChips
int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType,
TARGETING::TargetHandleList & i_chips)
{
using namespace PluginDef;
using namespace TARGETING;
PRDF_DENTER( "FabricDomain::OrderTheseChips" );
uint32_t l_internalOnlyCount = 0;
uint64_t l_externalDrivers[i_chips.size()];
uint64_t l_wofValues[i_chips.size()];
bool l_internalCS[i_chips.size()];
union { uint64_t * u; CPU_WORD * c; } ptr;
uint32_t l_chip = 0;
uint32_t l_chipToFront = 0;
// Get internal setting and external driver list for each chip.
for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i)
{
RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips);
ptr.u = &l_externalDrivers[l_chip];
BitString l_externalChips(i_chips.size(), ptr.c);
TargetHandleList l_tmpList;
if(l_fabChip != NULL)
{
// Call "GetCheckstopInfo" plugin.
ExtensibleChipFunction * l_extFunc
= l_fabChip->getExtensibleFunction("GetCheckstopInfo");
(*l_extFunc)(l_fabChip,
bindParm<bool &, TargetHandleList &, uint64_t &>
(l_internalCS[l_chip],
l_tmpList,
l_wofValues[l_chip]
)
);
}
else
{
l_internalCS[l_chip] = false;
PRDF_DTRAC( "FabricDomain::OrderTheseChips: l_fabChip is NULL" );
}
//If we are just checking for internal errors then there is no need for
//a list of what chips sent checkstops where.
// Update bit buffer.
for (TargetHandleList::iterator j = l_tmpList.begin();
j != l_tmpList.end();
++j)
{
for (uint32_t k = 0; k < i_chips.size(); k++)
if ((*j) == LookUp(k)->GetChipHandle())
l_externalChips.Set(k);
};
// Check if is internal.
if (l_internalCS[l_chip])
{
l_internalOnlyCount++;
l_chipToFront = l_chip;
}
l_chip++; //Move to next chip in the list.
}
// Check if we are done... only one with an internal error.
if (1 == l_internalOnlyCount)
{
MoveToFrontInTheseChips(l_chipToFront, i_chips);
return(SUCCESS);
}
PRDF_DEXIT( "FabricDomain::OrderTheseChips" );
return(SUCCESS);
}
示例6: processOccReset
// Notify HTMGT that an OCC has failed and needs to be reset
void processOccReset(TARGETING::Target * i_proc)
{
TMGT_INF(">>processOccReset(0x%p)", i_proc);
errlHndl_t errl = NULL;
TARGETING::Target * failedOccTarget = NULL;
TARGETING::Target* sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);
uint8_t safeMode = 0;
// If the system is in safemode then ignore request to reset OCCs
if(sys &&
sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode) &&
safeMode)
{
return;
}
// Get functional OCC (one per proc)
TARGETING::TargetHandleList pOccs;
getChildChiplets(pOccs, i_proc, TARGETING::TYPE_OCC);
if (pOccs.size() > 0)
{
failedOccTarget = pOccs[0];
}
if(NULL != failedOccTarget)
{
uint32_t huid = failedOccTarget->getAttr<TARGETING::ATTR_HUID>();
TMGT_INF("processOccReset(HUID=0x%08X) called", huid);
}
else
{
uint32_t huid = i_proc->getAttr<TARGETING::ATTR_HUID>();
TMGT_INF("processOccReset: Invalid OCC target (proc huid=0x08X)"
"resetting OCCs anyway",
huid);
/*@
* @errortype
* @reasoncode HTMGT_RC_INVALID_PARAMETER
* @moduleid HTMGT_MOD_PROCESS_OCC_RESET
* @userdata1[0:7] Processor HUID
* @devdesc No OCC target found for proc Target,
*/
bldErrLog(errl,
HTMGT_MOD_PROCESS_OCC_RESET,
HTMGT_RC_INVALID_PARAMETER,
huid, 0, 0, 1,
ERRORLOG::ERRL_SEV_INFORMATIONAL);
// Add HB firmware callout
errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_MED);
ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to NULL
}
errl = OccManager::resetOccs(failedOccTarget);
if(errl)
{
ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to NULL
}
TMGT_INF("<<processOccReset()");
} // end processOccReset()
示例7: processOccError
// Notify HTMGT that an OCC has an error to report
void processOccError(TARGETING::Target * i_procTarget)
{
TMGT_INF(">>processOccError(0x%p)", i_procTarget);
TARGETING::Target* sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);
uint8_t safeMode = 0;
// If the system is in safemode then can't talk to OCCs -
// ignore call to processOccError
if(sys &&
sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode) &&
safeMode)
{
return;
}
bool polledOneOcc = false;
errlHndl_t err = OccManager::buildOccs();
if (NULL == err)
{
if (i_procTarget != NULL)
{
const uint32_t l_huid =
i_procTarget->getAttr<TARGETING::ATTR_HUID>();
TMGT_INF("processOccError(HUID=0x%08X) called", l_huid);
TARGETING::TargetHandleList pOccs;
getChildChiplets(pOccs, i_procTarget, TARGETING::TYPE_OCC);
if (pOccs.size() > 0)
{
// Poll specified OCC flushing any errors
errlHndl_t err = OccManager::sendOccPoll(true, pOccs[0]);
if (err)
{
ERRORLOG::errlCommit(err, HTMGT_COMP_ID);
}
polledOneOcc = true;
}
}
if ((OccManager::getNumOccs() > 1) || (false == polledOneOcc))
{
// Send POLL command to all OCCs to flush any other errors
errlHndl_t err = OccManager::sendOccPoll(true);
if (err)
{
ERRORLOG::errlCommit(err, HTMGT_COMP_ID);
}
}
if (OccManager::occNeedsReset())
{
TMGT_ERR("processOccError(): OCCs need to be reset");
// Don't pass failed target as OCC should have already
// been marked as failed during the poll.
errlHndl_t err = OccManager::resetOccs(NULL);
if(err)
{
ERRORLOG::errlCommit(err, HTMGT_COMP_ID);
}
}
}
else
{
// OCC build failed...
TMGT_ERR("processOccError() called, but unable to find OCCs");
ERRORLOG::errlCommit(err, HTMGT_COMP_ID);
}
TMGT_INF("<<processOccError()");
} // end processOccError()
示例8: computeNonPhypRtTarget
/**
* @brief Returns the runtime target ID for a given targeting target for all
* hypervisors other than PHyp
* @param[in] i_pTarget Targeting target, must not be NULL (asserts
* otherwise)
* @param[out] o_rtTargetId Runtime target ID which maps to the given targeting
* target
* @return Error log handle
* @retval NULL Computed a valid runtime target ID for the given input
* targeting target and returned it in the output parameter.
* @retval !NULL Failed to compute a runtime target ID for the given input
* targeting target. Ignore output parameter.
*/
errlHndl_t computeNonPhypRtTarget(
const TARGETING::Target* i_pTarget,
RT_TARG::rtChipId_t& o_rtTargetId)
{
assert(i_pTarget != NULL);
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 targetingTargetType = i_pTarget->getAttr<TARGETING::ATTR_TYPE>();
if(targetingTargetType == TARGETING::TYPE_PROC)
{
uint32_t fabId =
i_pTarget->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
uint32_t procPos =
i_pTarget->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
o_rtTargetId = PIR_t::createChipId( fabId, procPos );
}
else if( targetingTargetType == TARGETING::TYPE_MEMBUF)
{
//MEMBUF
// 0b1000.0000.0000.0000.0000.0GGG.GCCC.MMMM
// where GGGG is group, CCC is chip, MMMM is memory channel
//
TARGETING::TargetHandleList targetList;
getParentAffinityTargets(targetList,
i_pTarget,
TARGETING::CLASS_UNIT,
TARGETING::TYPE_DMI);
if( targetList.empty() )
{
auto huid = get_huid(i_pTarget);
TRACFCOMP(g_trac_runtime, ERR_MRK
"No associated DMI targeting target(s) found for MEMBUF "
"targeting target with HUID of 0x%08X",
huid);
/*@
* @error
* @moduleid RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET
* @reasoncode RUNTIME::RT_UNIT_TARGET_NOT_FOUND
* @userdata1 MEMBUF targeting target's HUID
* @devdesc No associated DMI targeting target(s) found for
* given MEMBUF targeting target
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET,
RUNTIME::RT_UNIT_TARGET_NOT_FOUND,
huid,
0,
true);
ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target").
addToLog(pError);
break;
}
auto target = targetList[0];
auto pos = target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
targetList.clear();
getParentAffinityTargets(targetList,
target,
TARGETING::CLASS_CHIP,
TARGETING::TYPE_PROC);
if(targetList.empty())
{
pError = createProcNotFoundError(target);
break;
}
//.........这里部分代码省略.........
示例9: fenceAttachedMembufs
//******************************************************************************
// fenceAttachedMembufs - helper function for hwp proc_cen_ref_clk_enable
//******************************************************************************
void fenceAttachedMembufs( TARGETING::Target * i_procTarget )
{
errlHndl_t l_errl = NULL;
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Fencing attached (present) membuf chips downstream from "
"proc chip with HUID of 0x%08X",
i_procTarget->getAttr<TARGETING::ATTR_HUID>());
// Get list of membuf chips downstream from the given proc chip
TARGETING::TargetHandleList MembufChipList;
getChildAffinityTargetsByState( MembufChipList,
const_cast<TARGETING::Target*>(i_procTarget ),
TARGETING::CLASS_CHIP,
TARGETING::TYPE_MEMBUF,
TARGETING::UTIL_FILTER_PRESENT);
// loop through the membufs
for(TARGETING::TargetHandleList::const_iterator pTargetItr
= MembufChipList.begin();
pTargetItr != MembufChipList.end();
pTargetItr++)
{
//Get CFAM "1012" -- FSI GP3 and set bits 23-27 (various fence bits)
//Note 1012 is ecmd addressing, real address is 0x1048 (byte)
uint64_t l_addr = 0x1048;
const uint32_t l_fence_bits= 0x000001F0;
uint32_t l_data = 0;
size_t l_size = sizeof(uint32_t);
l_errl = deviceRead(*pTargetItr,
&l_data,
l_size,
DEVICE_FSI_ADDRESS(l_addr));
if (l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Failed getcfam 1012 to HUID 0x%08X, ignoring, skipping",
(*pTargetItr)->getAttr<TARGETING::ATTR_HUID>());
delete l_errl;
l_errl = NULL;
continue;
}
l_data |= l_fence_bits;
l_errl = deviceWrite(*pTargetItr,
&l_data,
l_size,
DEVICE_FSI_ADDRESS(l_addr));
if (l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Failed putcfam 1012 to HUID 0x%08X, ignoring, skipping",
(*pTargetItr)->getAttr<TARGETING::ATTR_HUID>());
delete l_errl;
l_errl = NULL;
continue;
}
}
}
示例10: call_proc_cen_ref_clk_enable
//******************************************************************************
// call_proc_cen_ref_clock_enable
//******************************************************************************
void* call_proc_cen_ref_clk_enable(void *io_pArgs )
{
errlHndl_t l_errl = NULL;
IStepError l_stepError;
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_proc_cen_ref_clock_enable enter" );
TARGETING::TargetHandleList functionalProcChipList;
getAllChips(functionalProcChipList, TYPE_PROC, true);
// loop thru the list of processors
for (TargetHandleList::const_iterator
l_proc_iter = functionalProcChipList.begin();
l_proc_iter != functionalProcChipList.end();
++l_proc_iter)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"target HUID %.8X",
TARGETING::get_huid( *l_proc_iter ));
uint8_t l_membufsAttached = 0;
// get a bit mask of present/functional dimms assocated with
// this processor
l_membufsAttached = getMembufsAttachedBitMask( *l_proc_iter );
//Perform a workaround for GA1 to raise fences on centaurs
//to prevent FSP from analyzing if HB TIs for recoverable
//errors
//RTC 106276
fenceAttachedMembufs( *l_proc_iter );
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"passing target HUID %.8X and 0x%x mask",
TARGETING::get_huid( *l_proc_iter ), l_membufsAttached );
if( l_membufsAttached )
{
fapi::Target l_fapiProcTarget( fapi::TARGET_TYPE_PROC_CHIP,
*l_proc_iter );
// Invoke the HWP passing in the proc target and
// a bit mask indicating connected centaurs
FAPI_INVOKE_HWP(l_errl,
proc_cen_ref_clk_enable,
l_fapiProcTarget, l_membufsAttached );
if (l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : proc_cen_ref_clk_enable",
"failed, returning errorlog" );
// capture the target data in the elog
ErrlUserDetailsTarget( *l_proc_iter ).addToLog( l_errl );
// Create IStep error log and cross ref error that occurred
l_stepError.addErrorDetails( l_errl );
// Commit error log
errlCommit( l_errl, HWPF_COMP_ID );
}
else
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : proc_cen_ref_clk_enable",
"completed ok");
}
}
} // endfor
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_proc_cen_ref_clock_enable exit" );
// end task, returning any errorlogs to IStepDisp
return l_stepError.getErrorHandle();
}
示例11: getMembufsAttachedBitMask
//******************************************************************************
// getMembufsAttachedBitMask - helper function for hwp proc_cen_ref_clk_enable
//******************************************************************************
uint8_t getMembufsAttachedBitMask( TARGETING::Target * i_procTarget )
{
const uint8_t MCS_WITH_ATTACHED_CENTAUR_MASK = 0x80;
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Finding functional membuf chips downstream from "
"proc chip with HUID of 0x%08X",
i_procTarget->getAttr<TARGETING::ATTR_HUID>());
uint8_t l_attachedMembufs = 0;
// Get list of functional membuf chips downstream from the given
// proc chip
TARGETING::TargetHandleList functionalMembufChipList;
getChildAffinityTargets( functionalMembufChipList,
const_cast<TARGETING::Target*>(i_procTarget ),
TARGETING::CLASS_CHIP,
TARGETING::TYPE_MEMBUF,
true);
// loop through the functional membufs
for(TARGETING::TargetHandleList::const_iterator pTargetItr
= functionalMembufChipList.begin();
pTargetItr != functionalMembufChipList.end();
pTargetItr++)
{
// Find each functional membuf chip's upstream functional MCS
// unit, if any, and accumulate it into the attached membuf
// chips mask
TARGETING::TargetHandleList functionalMcsUnitList;
getParentAffinityTargets( functionalMcsUnitList, *pTargetItr,
TARGETING::CLASS_UNIT, TARGETING::TYPE_MCS,
true );
if(functionalMcsUnitList.empty())
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Functional membuf chip with HUID of 0x%08X "
"is not attached to an upstream functional MCS",
(*pTargetItr)->getAttr<
TARGETING::ATTR_HUID>());
continue;
}
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Found functional MCS unit with HUID of 0x%08X "
"upstream from functional membuf chip with HUID of 0x%08X",
((*functionalMcsUnitList.begin())->getAttr<
TARGETING::ATTR_CHIP_UNIT>()),
(*pTargetItr)->getAttr<
TARGETING::ATTR_HUID>());
l_attachedMembufs |=
((MCS_WITH_ATTACHED_CENTAUR_MASK) >>
((*functionalMcsUnitList.begin())->getAttr<
TARGETING::ATTR_CHIP_UNIT>()));
}
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Proc chip with HUID of 0x%08X has attached membuf "
"mask (l_attachedMembufs) of 0x%02X",
i_procTarget->getAttr<TARGETING::ATTR_HUID>(),
l_attachedMembufs);
// return the bitmask
return l_attachedMembufs;
}
示例12: dimmPresenceDetect
// ------------------------------------------------------------------
// dimmPresenceDetect
// ------------------------------------------------------------------
errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType,
TARGETING::Target * i_target,
void * io_buffer,
size_t & io_buflen,
int64_t i_accessType,
va_list i_args )
{
errlHndl_t err = NULL;
bool present = false;
size_t presentSz = sizeof(present);
TRACSSCOMP( g_trac_spd,
ENTER_MRK"dimmPresenceDetect()" );
do
{
// Check to be sure that the buffer is big enough.
if( !(io_buflen >= sizeof(bool)) )
{
TRACFCOMP( g_trac_spd,
ERR_MRK"dimmPresenceDetect() - Invalid Data Length: %d",
io_buflen );
/*@
* @errortype
* @reasoncode VPD::VPD_INSUFFICIENT_BUFFER_SIZE
* @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
* @moduleid VPD::VPD_SPD_PRESENCE_DETECT
* @userdata1 Buffer Length
* @userdata2 <UNUSED>
* @devdesc Buffer for checking Presence Detect
* was not the correct size.
*/
err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
VPD::VPD_SPD_PRESENCE_DETECT,
VPD::VPD_INSUFFICIENT_BUFFER_SIZE,
TO_UINT64(io_buflen),
0x0,
true /*Add HB Software Callout*/);
err->collectTrace( "SPD", 256);
break;
}
// Is the target present
#ifdef CONFIG_DJVPD_READ_FROM_HW
// Check if the parent MBA/MEMBUF is present. If it is not then
// no reason to check the DIMM which would otherwise generate
// tons of FSI errors. We can't just check if parent MBA
// is functional because DIMM presence detect is called before
// the parent MBA/MEMBUF is set as present/functional.
TARGETING::TargetHandleList membufList;
TARGETING::PredicateCTM membufPred( TARGETING::CLASS_CHIP,
TARGETING::TYPE_MEMBUF );
TARGETING::targetService().getAssociated(
membufList,
i_target,
TARGETING::TargetService::PARENT_BY_AFFINITY,
TARGETING::TargetService::ALL,
&membufPred);
bool parentPresent = false;
const TARGETING::TargetHandle_t membufTarget = *(membufList.begin());
err = deviceRead(membufTarget, &parentPresent, presentSz,
DEVICE_PRESENT_ADDRESS());
if (err)
{
TRACFCOMP(
g_trac_spd,
"Error reading parent MEMBUF present: huid 0x%X DIMM huid 0x%X",
TARGETING::get_huid(membufTarget),
TARGETING::get_huid(i_target) );
break;
}
if (!parentPresent)
{
present = false;
// Invalidate the SPD in PNOR
err = VPD::invalidatePnorCache(i_target);
if (err)
{
TRACFCOMP( g_trac_spd, "Error invalidating SPD in PNOR" );
}
break;
}
#endif
present = spdPresent( i_target );
if( present == false )
{
TRACUCOMP( g_trac_spd,
INFO_MRK"Dimm was found to be NOT present." );
}
else
//.........这里部分代码省略.........
示例13: initiateDrtm
errlHndl_t initiateDrtm()
{
SB_ENTER("initiateDrtm");
errlHndl_t pError = nullptr;
// For DRTM, the thread has to be pinned to a core (and therefore pinned to
// a chip)
task_affinity_pin();
void* drtmPayloadVirtAddr = nullptr;
do
{
const std::vector<SECUREBOOT::ProcSecurity> LLP {
SECUREBOOT::ProcSecurity::LLPBit,
};
const std::vector<SECUREBOOT::ProcSecurity> LLS {
SECUREBOOT::ProcSecurity::LLSBit,
};
// Determine which fabric group and chip this task is executing on and
// create a filter to find the matching chip target
auto cpuId = task_getcpuid();
auto groupId = PIR_t::groupFromPir(cpuId);
auto chipId = PIR_t::chipFromPir(cpuId);
TARGETING::PredicateAttrVal<TARGETING::ATTR_FABRIC_GROUP_ID>
matchesGroup(groupId);
TARGETING::PredicateAttrVal<TARGETING::ATTR_FABRIC_CHIP_ID>
matchesChip(chipId);
TARGETING::PredicatePostfixExpr matchesGroupAndChip;
matchesGroupAndChip.push(&matchesGroup).push(&matchesChip).And();
// Get all the functional proc chips and find the chip we're running on
TARGETING::TargetHandleList funcProcChips;
TARGETING::getAllChips(funcProcChips,
TARGETING::TYPE_PROC);
if(funcProcChips.empty())
{
// TODO: RTC 167205: GA error handling
assert(false,"initiateDrtm: BUG! Functional proc chips is empty, "
"yet this code is running on a functional chip!");
break;
}
// NOTE: std::find_if requires predicates to be copy constructable, but
// predicates are not; hence use a wrapper lambda function to bypass
// that limitation
auto pMatch =
std::find_if(funcProcChips.begin(),funcProcChips.end(),
[&matchesGroupAndChip] ( TARGETING::Target* pTarget )
{
return matchesGroupAndChip(pTarget);
} );
if(pMatch == funcProcChips.end())
{
// TODO: RTC 167205: GA error handling
assert(false, "initiateDrtm: BUG! No functional chip found "
"to be running this code");
break;
}
// Move the matching target to the end of the list.
// NOTE: If reverse iterators were supported, we could have verified the
// last element of the container is not the match, and done a
// std::iter_swap of the match and the last element
TARGETING::Target* const pMatchTarget = *pMatch;
funcProcChips.erase(pMatch);
funcProcChips.push_back(pMatchTarget);
// Map to the DRTM payload area in mainstore
const uint32_t drtmPayloadPhysAddrMb = DRTM_RIT_PAYLOAD_PHYS_ADDR_MB;
drtmPayloadVirtAddr = mm_block_map(
reinterpret_cast<void*>(drtmPayloadPhysAddrMb*BYTES_PER_MEGABYTE),
PAGESIZE);
if(drtmPayloadVirtAddr == nullptr)
{
// TODO: RTC 167205: GA error handling
assert(false, "initiateDrtm: BUG! Failed in call to mm_block_map "
"to map the DRTM payload.");
break;
}
// Copy the DRTM payload to the DRTM payload area
memcpy(
reinterpret_cast<uint32_t*>(drtmPayloadVirtAddr),
DRTM_RIT_PAYLOAD,
sizeof(DRTM_RIT_PAYLOAD));
// The required generic sequencing to initiate DRTM is as follows:
// 1) Initiating task must pin itself to a core (to ensure it
// will not be accidentally queisced by SBE)
// 2) It must set the DRTM payload information in the master processor
// mailbox scratch registers (registers 7 and 8) before it goes
// offline
// 3) It must determine the processor it's currently running on
// 4) It must set the late launch bit (LL) on all other processors
// 4a) If the given processor is an active master, it must set
//.........这里部分代码省略.........
示例14: configureHbrtHypIds
errlHndl_t configureHbrtHypIds(const bool i_configForPhyp)
{
TRACDCOMP( g_trac_runtime, ENTER_MRK "configureHbrtHypIds" );
errlHndl_t pError = NULL;
TARGETING::PredicateCTM isaProc(
TARGETING::CLASS_CHIP, TARGETING::TYPE_PROC);
TARGETING::PredicateCTM isaMembuf(
TARGETING::CLASS_CHIP, TARGETING::TYPE_MEMBUF);
TARGETING::PredicateCTM isaCore(
TARGETING::CLASS_UNIT, TARGETING::TYPE_CORE);
TARGETING::PredicatePostfixExpr isaProcMembufOrCore;
isaProcMembufOrCore.push(&isaProc).push(&isaMembuf).Or()
.push(&isaCore).Or();
TARGETING::TargetRangeFilter pIt(
TARGETING::targetService().begin(),
TARGETING::targetService().end(),
&isaProcMembufOrCore);
for (; pIt; ++pIt)
{
auto hbrtHypId = HBRT_HYP_ID_UNKNOWN;
// Phyp is the only special case
if(i_configForPhyp)
{
auto rtType = RT_TYPE_UNKNOWN;
pError = getRtTypeForTarget(*pIt,rtType);
if(pError)
{
break;
}
if( (*pIt)->getAttr<TARGETING::ATTR_TYPE>()
== TARGETING::TYPE_CORE)
{
if(TARGETING::is_fused_mode())
{
// If we're in fused core mode, all core ID's must
// match that of the parent EX
auto type = TARGETING::TYPE_EX;
const TARGETING::Target* pEx =
TARGETING::getParent(*pIt,type);
// If this fails, everything is already hosed
assert(pEx != NULL);
hbrtHypId = (pEx)->getAttr<TARGETING::ATTR_ORDINAL_ID>();
}else
{
hbrtHypId = (*pIt)->getAttr<TARGETING::ATTR_ORDINAL_ID>();
}
}
else if( (*pIt)->getAttr<TARGETING::ATTR_TYPE>()
== TARGETING::TYPE_MEMBUF )
{
//MEMBUF
// 0b1000.0000.0000.0000.0000.0PPP.PPPP.MMMM
// where PP is the parent proc's id, MMMM is memory channel
//
TARGETING::TargetHandleList targetList;
getParentAffinityTargets(targetList,
(*pIt),
TARGETING::CLASS_UNIT,
TARGETING::TYPE_MCS);
assert( !targetList.empty() );
auto mcs_target = targetList[0];
auto pos = mcs_target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
targetList.clear();
getParentAffinityTargets(targetList,
mcs_target,
TARGETING::CLASS_CHIP,
TARGETING::TYPE_PROC);
assert( !targetList.empty() );
auto procTarget = targetList[0];
hbrtHypId = procTarget->getAttr<TARGETING::ATTR_ORDINAL_ID>();
hbrtHypId = (hbrtHypId << RT_TARG::MEMBUF_ID_SHIFT);
hbrtHypId += pos;
}
else // just PROC
{
hbrtHypId = (*pIt)->getAttr<TARGETING::ATTR_ORDINAL_ID>();
}
hbrtHypId |= rtType;
}
else
{
pError = computeNonPhypRtTarget(*pIt,hbrtHypId);
if(pError)
{
break;
}
}
(*pIt)->setAttr<TARGETING::ATTR_HBRT_HYP_ID>(hbrtHypId);
//.........这里部分代码省略.........
示例15: l_fapiproc_target
//******************************************************************************
// wrapper function to call proc_build_smp
//******************************************************************************
void* call_proc_build_smp( void *io_pArgs )
{
errlHndl_t l_errl = NULL;
IStepError l_StepError;
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_proc_build_smp entry" );
do
{
// Get all functional proc chip targets
TARGETING::TargetHandleList l_cpuTargetList;
getAllChips(l_cpuTargetList, TYPE_PROC);
// Collect all valid abus connections and xbus connections
TargetPairs_t l_abusConnections;
TargetPairs_t l_xbusConnections;
l_errl = PbusLinkSvc::getTheInstance().getPbusConnections(
l_abusConnections, TYPE_ABUS, false );
if (l_errl)
{
// Create IStep error log and cross reference error that occurred
l_StepError.addErrorDetails( l_errl);
// Commit error
errlCommit( l_errl, HWPF_COMP_ID );
}
// Get XBUS connections
l_errl = PbusLinkSvc::getTheInstance().getPbusConnections(
l_xbusConnections, TYPE_XBUS, false );
if (l_errl)
{
// Create IStep error log and cross reference error that occurred
l_StepError.addErrorDetails( l_errl);
// Commit error
errlCommit( l_errl, HWPF_COMP_ID );
}
// Populate l_proc_Chips vector for each good processor chip
// if a A/X-bus endpoint has a valid connection, then
// obtain the proc chip target of the other endpoint of the
// connection, build the fapi target to update the corresponding
// chip object of this A/X-bus endpoint for the procEntry
std::vector<proc_build_smp_proc_chip> l_procChips;
// Get the master proc
TARGETING::Target * l_masterProc = NULL;
(void)TARGETING::targetService().
masterProcChipTargetHandle( l_masterProc );
for (TARGETING::TargetHandleList::const_iterator
l_cpuIter = l_cpuTargetList.begin();
l_cpuIter != l_cpuTargetList.end();
++l_cpuIter)
{
const TARGETING::Target* l_pTarget = *l_cpuIter;
fapi::Target l_fapiproc_target( TARGET_TYPE_PROC_CHIP,
(const_cast<TARGETING::Target*>(l_pTarget)));
proc_build_smp_proc_chip l_procEntry;
l_procEntry.this_chip = l_fapiproc_target;
l_procEntry.enable_f0 = false;
l_procEntry.enable_f1 = false;
if (l_pTarget == l_masterProc)
{
l_procEntry.master_chip_sys_next = true;
}
else
{
l_procEntry.master_chip_sys_next = false;
}
// Get A-BUS
//abus connections were found so can get the a-bus
TARGETING::TargetHandleList l_abuses;
getChildChiplets( l_abuses, l_pTarget, TYPE_ABUS );
for (TARGETING::TargetHandleList::const_iterator
l_abusIter = l_abuses.begin();
l_abusIter != l_abuses.end();
++l_abusIter)
{
const TARGETING::Target * l_target = *l_abusIter;
uint8_t l_srcID = l_target->getAttr<ATTR_CHIP_UNIT>();
TargetPairs_t::iterator l_itr =
l_abusConnections.find(l_target);
if ( l_itr == l_abusConnections.end() )
{
continue;
}
fapi::Target l_fapiEndpointTarget(TARGET_TYPE_ABUS_ENDPOINT,
(const_cast<TARGETING::Target*>(l_itr->second)) );
//.........这里部分代码省略.........