Ejemplo n.º 1
0
//
//  Utility function to get DMI IO target list
//  First is MCS target, Second is MEMBUF target
//
void get_dmi_io_targets(TargetPairs_t& o_dmi_io_targets)
{
    TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "get_dmi_io_targets" );

    o_dmi_io_targets.clear();
    TARGETING::TargetHandleList l_cpuTargetList;
    getAllChips(l_cpuTargetList, TYPE_PROC);

    for ( TargetHandleList::const_iterator
          l_iter = l_cpuTargetList.begin();
          l_iter != l_cpuTargetList.end();
          ++l_iter )
    {
        //  make a local copy of the CPU target
        const TARGETING::Target*  l_cpu_target = *l_iter;

        // find all MCS chiplets of the proc
        TARGETING::TargetHandleList l_mcsTargetList;
        getChildChiplets( l_mcsTargetList, l_cpu_target, TYPE_MCS );

        for ( TargetHandleList::const_iterator
              l_iterMCS = l_mcsTargetList.begin();
              l_iterMCS != l_mcsTargetList.end();
              ++l_iterMCS )
        {
            //  make a local copy of the MCS target
            const TARGETING::Target*  l_mcs_target = *l_iterMCS;

            //  find all the Centaurs that are associated with this MCS
            TARGETING::TargetHandleList l_memTargetList;
            getChildAffinityTargets(l_memTargetList, l_mcs_target,
                     CLASS_CHIP, TYPE_MEMBUF);

            for ( TargetHandleList::const_iterator
                    l_iterMemBuf = l_memTargetList.begin();
                    l_iterMemBuf != l_memTargetList.end();
                    ++l_iterMemBuf )
            {
                //  make a local copy of the MEMBUF target
                const TARGETING::Target*  l_mem_target = *l_iterMemBuf;
                o_dmi_io_targets.insert(std::pair<const TARGETING::Target*,
                  const TARGETING::Target*>(l_mcs_target, l_mem_target));

            }  //end for l_mem_target

        }   // end for l_mcs_target

    }   // end for l_cpu_target

    TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "get_dmi_io_targets exit" );

    return;
}
Ejemplo n.º 2
0
errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections,
                                         TYPE i_busType, bool i_noDuplicate )
{
    errlHndl_t l_errl = NULL;
    TargetPairs_t * l_PbusConnections = NULL;
    o_PbusConnections.clear();

    mutex_lock(&iv_mutex);

    if (i_busType == TYPE_ABUS)
    {
        if (iv_abusConnections.size() == 0)
        {
            l_errl = collectPbusConections( TYPE_ABUS );
        }
        if (l_errl == NULL)
        {
            l_PbusConnections = i_noDuplicate ? &iv_abusUniqueConnections :
                                            &iv_abusConnections;
        }
    }
    else
    {
        if (iv_xbusConnections.size() == 0)
        {
            l_errl = collectPbusConections( TYPE_XBUS );
        }
        if (l_errl == NULL)
        {
            l_PbusConnections = i_noDuplicate ? &iv_xbusUniqueConnections :
                                            &iv_xbusConnections;
        }
    }

    if (l_errl == NULL)
    {
        o_PbusConnections.insert( (*l_PbusConnections).begin(),
                                              (*l_PbusConnections).end() );
    }

    mutex_unlock(&iv_mutex);

    return l_errl;
}