当前位置: 首页>>代码示例>>C++>>正文


C++ FAPI_ERR函数代码示例

本文整理汇总了C++中FAPI_ERR函数的典型用法代码示例。如果您正苦于以下问题:C++ FAPI_ERR函数的具体用法?C++ FAPI_ERR怎么用?C++ FAPI_ERR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FAPI_ERR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: targetTest8

//******************************************************************************
// targetTest8
//******************************************************************************
uint32_t targetTest8()
{
    uint32_t l_result = 0;
    uint8_t l_handle = 7;
    void * l_pHandle = reinterpret_cast<void *>(&l_handle);

    // Create Target
    Target l_target(TARGET_TYPE_L4, l_pHandle);

    // an L4 Target is not a chip
    if ( l_target.isChip() )
    {
        FAPI_ERR("targetTest8. L4 target incorrectly"
                                " identified itself as a chip");
        l_result = 1;
    }
    else
    {

        if ( !l_target.isChiplet() )
        {
            FAPI_ERR("targetTest8. L4 target failed to identify as a chiplett" );
            l_result = 2;
        }
        else
        {
            FAPI_INF("targetTest8. Success!");
        }
    }

    // Set the handle pointer to NULL to prevent any problem on destruction
    l_target.set(NULL);

    return l_result;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:38,代码来源:fapiTargetTest.C

示例2: proc_tod_init

//------------------------------------------------------------------------------
// function: proc_tod_init
//
// parameters: i_tod_node  Reference to TOD topology (FAPI targets included within)
//
// returns: FAPI_RC_SUCCESS if TOD topology is successfully initialized
//          else FAPI or ECMD error is sent through
//------------------------------------------------------------------------------
fapi::ReturnCode proc_tod_init(const tod_topology_node* i_tod_node)
{
    fapi::ReturnCode rc;

    FAPI_INF("proc_tod_init: Start");
    do
    {
        if (i_tod_node == NULL)
        {
            FAPI_ERR("proc_tod_setup: null node passed into function!");
            FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_NULL_NODE);
            break;
        }

        rc = proc_tod_clear_error_reg(i_tod_node);
        if (!rc.ok())
        {
            FAPI_ERR("proc_tod_setup: Failure clearing TOD error registers!");
            break;
        }

        //Start configuring each node; (init_tod_node will recurse on each child)
        rc = init_tod_node(i_tod_node);
        if (!rc.ok())
        {
            FAPI_ERR("proc_tod_setup: Failure initializing TOD!");
            break;
        }

    } while (0);

    FAPI_INF("proc_tod_init: End");
    return rc;
}
开发者ID:gdhh,项目名称:hostboot,代码行数:42,代码来源:proc_tod_init.C

示例3: equalize_throttles

///
/// @brief Equalize the throttles among OCMB chips
/// @param[in] i_targets vector of OCMB chips
/// @param[in] i_throttle_type thermal boolean to determine whether to calculate throttles based on the power regulator or thermal limits
/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
/// @note equalizes the throttles to the lowest of runtime and the lowest slot-throttle value
///
fapi2::ReturnCode equalize_throttles( const std::vector< fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP> >& i_targets,
                                      const mss::throttle_type i_throttle_type)
{
    FAPI_INF("Start equalize_throttles for %s type throttling",
             (( i_throttle_type == mss::throttle_type::THERMAL) ? "THERMAL" : "POWER"));

    std::vector< fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT> > l_exceeded_power;

    // Set all of the throttles to the lowest value per port for performance reasons
    FAPI_TRY(mss::power_thermal::equalize_throttles(i_targets, i_throttle_type, l_exceeded_power));

    // Report any port that exceeded the max power limit, and return a failing RC if we have any
    for (const auto& l_port : l_exceeded_power)
    {
        FAPI_ERR(" MEM_PORT %s estimated power exceeded the maximum allowed", mss::c_str(l_port) );
        fapi2::current_err = fapi2::FAPI2_RC_FALSE;
    }

    FAPI_INF("End equalize_throttles");
    return fapi2::current_err;

fapi_try_exit:
    FAPI_ERR("Error calculating equalize_throttles using %s throttling",
             ((i_throttle_type == mss::throttle_type::POWER) ? "power" : "thermal"));
    return fapi2::current_err;
}
开发者ID:open-power,项目名称:hostboot,代码行数:33,代码来源:exp_throttle.C

示例4: targetTest1

//******************************************************************************
// targetTest1
//******************************************************************************
uint32_t targetTest1()
{
    uint32_t l_result = 0;

    // Create Target using default constructor
    Target l_target;

    // Ensure that the handle pointer is NULL
    void * l_pHandle = l_target.get();

    if (l_pHandle != NULL)
    {
        FAPI_ERR("targetTest1. Handle is not NULL");
        l_result = 1;
    }
    else
    {
        // Ensure that the type is TARGET_TYPE_NONE
        TargetType l_type = l_target.getType();

        if (l_type != TARGET_TYPE_NONE)
        {
            FAPI_ERR("targetTest1. Type is 0x%x, expected NONE", l_type);
            l_result = 2;
        }
        else
        {
            FAPI_INF("targetTest1. Success!");
        }
    }

    return l_result;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:36,代码来源:fapiTargetTest.C

示例5: proc_tod_save_single_reg

//------------------------------------------------------------------------------
// function: proc_tod_save_single_reg
//
// parameters: i_target FAPI target
//             i_addr   SCOM address to read
//             o_data   Buffer to save register read
//
// returns: FAPI_RC_SUCCESS if the given register was read and saved into buffer
//          else FAPI or ECMD error is sent through
//------------------------------------------------------------------------------
fapi::ReturnCode proc_tod_save_single_reg(const fapi::Target& i_target,
                                          const uint64_t      i_addr,
                                          ecmdDataBufferBase& o_data)
{
    fapi::ReturnCode rc;
    uint32_t rc_ecmd = 0;

    FAPI_DBG("proc_tod_save_single_reg: Start");
    do
    {
        rc_ecmd |= o_data.setBitLength(64);
        if (rc_ecmd)
        {
            FAPI_ERR("proc_tod_save_single_reg: Error 0x%08X in ecmdDataBuffer setup for 0x%016llX SCOM.",  rc_ecmd, i_addr);
            rc.setEcmdError(rc_ecmd);
            break;
        }
        rc=fapiGetScom(i_target,i_addr,o_data);
        if (!rc.ok())
        {
            FAPI_ERR("proc_tod_save_single_reg: Error from fapiGetScom when retrieving 0x%016llX...", i_addr);
            break;
        }
        FAPI_DBG("proc_tod_save_single_reg: %016llX = %016llX",i_addr, o_data.getDoubleWord(0));
    } while(0);

    FAPI_DBG("proc_tod_save_single_reg: End");
    return rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:39,代码来源:proc_tod_save_config.C

示例6: pllInfoGetChipNameEc

/**
 * @brief Returns a chip's name and EC level
 *
 * @param[in]  i_attr Attribute ID (just used for tracing)
 * @param[in]  i_chip Reference to Chip fapi target
 * @param[out] o_name Filled in with the chip name
 * @param[out] o_ec   Filled in with the chip EC level
 *
 * @return fapi::ReturnCode Indicating success or error
 */
fapi::ReturnCode pllInfoGetChipNameEc(
    const fapi::getPllRingInfo::Attr i_attr,
    const fapi::Target & i_chip,
    fapi::ATTR_NAME_Type & o_name,
    fapi::ATTR_EC_Type & o_ec)
{
    fapi::ReturnCode l_rc;

    // As an Attribute Accessor HWP that needs the chip's name/EC to figure out
    // the data to return, it is valid to access these privileged attributes
    l_rc = FAPI_ATTR_GET_PRIVILEGED(ATTR_NAME, &i_chip, o_name);

    if (l_rc)
    {
        FAPI_ERR("getPllRingInfoAttr: error getting ATTR_NAME for attr %d",
                 i_attr);
    }
    else
    {
        l_rc = FAPI_ATTR_GET_PRIVILEGED(ATTR_EC, &i_chip, o_ec);

        if (l_rc)
        {
            FAPI_ERR("getPllRingInfoAttr: error getting ATTR_EC for attr %d",
                     i_attr);
        }
    }

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:40,代码来源:getPllRingInfoAttr.C

示例7: is_dimm_functional

///
/// @brief Check if a given DIMM is functional
/// @param[in] i_valid_dimm_bitmap from ATTR_CEN_MSS_EFF_DIMM_FUNCTIONAL_VECTOR
/// @param[in] i_port port index [0:1]
/// @param[in] i_dimm dimm index [0:1]
/// @return true if dimm is functional, false otherwise
///
bool is_dimm_functional(const uint8_t i_valid_dimm_bitmap,
                        const uint8_t i_port,
                        const uint8_t i_dimm)
{
    // TODO - RTC:174931 See if we can clean up is_dimm_functional when indexing API is implemented
    constexpr uint8_t PORT0_DIMM0_BIT_POS = 0;
    constexpr uint8_t PORT0_DIMM1_BIT_POS = 1;
    constexpr uint8_t PORT1_DIMM0_BIT_POS = 4;
    constexpr uint8_t PORT1_DIMM1_BIT_POS = 5;

    // Map that represents a valid dimm position for ATTR_CEN_MSS_EFF_DIMM_FUNCTIONAL_VECTOR
    // Taken from attribute description
    static constexpr uint8_t const VALID_DIMM_POS[MAX_PORTS_PER_MBA][MAX_DIMM_PER_PORT] =
    {
        { PORT0_DIMM0_BIT_POS, PORT0_DIMM1_BIT_POS },
        { PORT1_DIMM0_BIT_POS, PORT1_DIMM1_BIT_POS },
    };

    if (i_port >= MAX_PORTS_PER_MBA)
    {
        FAPI_ERR("Port index out of bounds: %d", i_port);
        fapi2::Assert(false);
    }

    if (i_dimm >= MAX_DIMM_PER_PORT)
    {
        FAPI_ERR("DIMM index out of bounds: %d", i_dimm);
        fapi2::Assert(false);
    }

    // We are just checking bits are set from bitmap
    // that states whether a certain dimm is functional
    return fapi2::buffer<uint8_t>(i_valid_dimm_bitmap).getBit(VALID_DIMM_POS[i_port][i_dimm]);
}
开发者ID:wghoffa,项目名称:hostboot,代码行数:41,代码来源:mem_size.C

示例8: proc_fab_iovalid_write_active_mask

//------------------------------------------------------------------------------
// function: utility subroutine which writes AND/OR mask register to
//           set/clear desired bits
// parameters: i_target        => target
//             i_active_mask   => bit mask defining active bits to act on
//             i_set_not_clear => define desired operation
//                                (true=set, false=clear)
//             i_and_mask_addr => SCOM address for AND mask register
//             i_or_mask_addr  => SCOM address for OR mask register
// returns: FAPI_RC_SUCCESS if operation was successful, else error
//------------------------------------------------------------------------------
fapi::ReturnCode proc_fab_iovalid_write_active_mask(
    const fapi::Target& i_target,
    ecmdDataBufferBase& i_active_mask,
    bool i_set_not_clear,
    const uint32_t& i_and_mask_addr,
    const uint32_t& i_or_mask_addr)
{
    // data buffer to hold final bit mask
    ecmdDataBufferBase mask(64);

    // return codes
    uint32_t rc_ecmd = 0;
    fapi::ReturnCode rc;

    // mark function entry
    FAPI_DBG("proc_fab_iovalid_write_active_mask: Start");

    do
    {
        // copy input mask
        rc_ecmd = i_active_mask.copy(mask);
        // form final mask based on desired operation (set/clear)
        if (!i_set_not_clear)
        {
            FAPI_DBG("proc_fab_iovalid_write_active_mask: Inverting active mask");
            rc_ecmd |= mask.invert();
        }

        // check return code from buffer manipulation operations
        if (rc_ecmd)
        {
            FAPI_ERR("proc_fab_iovalid_write_active_mask: Error 0x%x setting up active mask data buffer",
                     rc_ecmd);
            rc.setEcmdError(rc_ecmd);
            break;
        }

        // write register (use OR mask address for set operation,
        // AND mask address for clear operation)
        rc = fapiPutScom(i_target,
                         i_set_not_clear?i_or_mask_addr:i_and_mask_addr,
                         mask);
        if (!rc.ok())
        {
            FAPI_ERR("proc_fab_iovalid_write_active_mask: fapiPutScom error (0x%08X)",
                     i_set_not_clear?i_or_mask_addr:i_and_mask_addr);
            break;
        }

    } while (0);

    // mark function exit
    FAPI_DBG("proc_fab_iovalid_write_active_mask: End");
    return rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:66,代码来源:proc_fab_iovalid.C

示例9: proc_tod_clear_error_reg

//------------------------------------------------------------------------------
// function: proc_tod_clear_error_reg
//
// parameters: i_tod_node  Reference to TOD topology (FAPI targets included within)
//
// returns: FAPI_RC_SUCCESS if every TOD node is cleared of errors
//          else FAPI or ECMD error is sent through
//------------------------------------------------------------------------------
fapi::ReturnCode proc_tod_clear_error_reg(const tod_topology_node* i_tod_node)
{
    fapi::ReturnCode rc;
    ecmdDataBufferBase data(64);
    uint32_t rc_ecmd = 0;
    fapi::Target* target = i_tod_node->i_target;

    FAPI_INF("proc_tod_clear_error_reg: Start");
    do
    {
        if (i_tod_node == NULL)
        {
            FAPI_ERR("proc_tod_clear_error_reg: null node passed into function!");
            FAPI_SET_HWP_ERROR(rc, RC_PROC_TOD_NULL_NODE);
            break;
        }

        FAPI_DBG("proc_tod_clear_error_reg: Clear any previous errors from TOD_ERROR_REG_00040030");
        rc_ecmd |= data.flushTo1();
        if (rc_ecmd)
        {
            FAPI_ERR("proc_tod_clear_error_reg: Error 0x%08X in ecmdDataBuffer setup for TOD_ERROR_REG_00040030.",  rc_ecmd);
            rc.setEcmdError(rc_ecmd);
            break;
        }
        rc = fapiPutScom(*target, TOD_ERROR_REG_00040030, data);
        if (!rc.ok())
        {
            FAPI_ERR("proc_tod_clear_error_reg: Could not write TOD_ERROR_REG_00040030.");
            break;
        }

        for (std::list<tod_topology_node*>::const_iterator child = (i_tod_node->i_children).begin();
             child != (i_tod_node->i_children).end();
             ++child)
        {
            tod_topology_node* tod_node = *child;
            rc = proc_tod_clear_error_reg(tod_node);
            if (!rc.ok())
            {
                FAPI_ERR("proc_tod_clear_error_reg: Failure clearing errors from downstream node!");
                break;
            }
        }
        if (!rc.ok())
        {
            break;  // error in above for loop
        }
    } while (0);

    FAPI_INF("proc_tod_clear_error_reg: End");
    return rc;
}
开发者ID:gdhh,项目名称:hostboot,代码行数:61,代码来源:proc_tod_init.C

示例10: platPutRing

// This will be used in future Cumulus code
/// @brief Platform-level implementation called by putRing()
inline ReturnCode platPutRing(const Target<TARGET_TYPE_ALL>& i_target,
                              const scanRingId_t i_address,
                              variable_buffer& i_data,
                              const RingMode i_ringMode)
{
    FAPI_DBG(ENTER_MRK "platPutRing");
    ReturnCode l_rc;
    errlHndl_t l_err = NULL;

    // Note: Trace is placed here in plat code because PPE doesn't support
    //       trace in common fapi2_hw_access.H
    bool l_traceit = platIsScanTraceEnabled();

    // Extract the component pointer
    TARGETING::Target* l_target =
            reinterpret_cast<TARGETING::Target*>(i_target.get());

    // Grab the name of the target
    TARGETING::ATTR_FAPI_NAME_type l_targName = {0};
    fapi2::toString(i_target, l_targName, sizeof(l_targName));

    // Output buffer must be set to ring's len by user
    uint64_t l_ringLen = i_data.getBitLength();
    uint64_t l_flag = platGetDDScanMode(i_ringMode);
    size_t l_size = i_data.getLength<uint8_t>();
    l_err = deviceWrite(l_target,
                        i_data.pointer(),
                        l_size,
                        DEVICE_SCAN_ADDRESS(i_address, l_ringLen, l_flag));
    if (l_err)
    {
        FAPI_ERR("platPutRing: deviceRead returns error!");
        FAPI_ERR("fapiPutRing failed - Target %s, Addr %.16llX",
                  l_targName, i_address);
        // Add the error log pointer as data to the ReturnCode
        l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err));
    }

    if (l_traceit)
    {
        uint64_t l_data = i_data.get<uint64_t>();
        FAPI_SCAN("TRACE : PUTRING     :  %s : %.16llX %.16llX",
                  l_targName,
                  i_address,
                  l_data);
    }

    FAPI_DBG(EXIT_MRK "platPutRing");
    return l_rc;
}
开发者ID:wghoffa,项目名称:hostboot,代码行数:52,代码来源:plat_hw_access.C

示例11: fapiPutScom

//******************************************************************************
// fapiPutScom function
//******************************************************************************
fapi::ReturnCode fapiPutScom(const fapi::Target& i_target,
                             const uint64_t i_address,
                             ecmdDataBufferBase & i_data)
{
    fapi::ReturnCode l_rc;
    bool l_traceit = platIsScanTraceEnabled();

    // call the platform implementation
    l_rc = platPutScom( i_target, i_address, i_data );

    if (l_rc)
    {
        FAPI_ERR("fapiPutScom failed - Target %s, Addr %.16llX",
                  i_target.toEcmdString(), i_address);
    }

    if( l_traceit )
    {
        FAPI_SCAN( "TRACE : PUTSCOM     : %s : %.16llX %.16llX",
                   i_target.toEcmdString(),
                   i_address,
                   i_data.getDoubleWord( 0 )  );
    }

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:29,代码来源:fapiHwAccess.C

示例12: _fapiGetSpyImage

fapi::ReturnCode _fapiGetSpyImage(const fapi::Target& i_target,
                            const char * const i_spyId,
                            ecmdDataBufferBase & o_data,
                            const ecmdDataBufferBase & i_imageData)
{
    fapi::ReturnCode l_rc;
    bool l_traceit = platIsScanTraceEnabled();

    // call the platform implementation
    l_rc = platGetSpyImage( i_target, i_spyId, o_data, i_imageData );

    if (l_rc)
    {
      FAPI_ERR("fapiGetSpyImage failed - Target %s, SpyId %s",
                i_target.toEcmdString(), i_spyId);
    }

    if( l_traceit )
    {
      FAPI_SCAN( "TRACE : GETSPYIMAGE : %s : %s %.16llX",
                   i_target.toEcmdString(),
                   i_spyId,
                   o_data.getDoubleWord(0));

    }

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:28,代码来源:fapiHwAccess.C

示例13: fapiGetRing

fapi::ReturnCode fapiGetRing(const fapi::Target& i_target,
                             const scanRingId_t i_address,
                             ecmdDataBufferBase & o_data,
                             const uint32_t i_ringMode)
{
    fapi::ReturnCode l_rc;
    bool l_traceit = platIsScanTraceEnabled();

    // call the platform implementation
    l_rc = platGetRing( i_target, i_address, o_data, i_ringMode );

    if (l_rc)
    {
        FAPI_ERR("fapiGetRing failed - Target %s, Addr 0x%.16llX", 
                  i_target.toEcmdString(), i_address);
    }

    if( l_traceit )
    {
        FAPI_SCAN( "TRACE : GETRING     : %s : %.16llX %.16llX", 
                   i_target.toEcmdString(),
                   i_address,
                   o_data.getDoubleWord( 0 ) );
    }

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:27,代码来源:fapiHwAccess.C

示例14: fapiPutCfamRegister

//******************************************************************************
// fapiPutCfamRegister function
//******************************************************************************
fapi::ReturnCode fapiPutCfamRegister(const fapi::Target& i_target,
                                     const uint32_t i_address,
                                     ecmdDataBufferBase & i_data)
{
    fapi::ReturnCode l_rc;
    bool l_traceit = platIsScanTraceEnabled();

    // call the platform implementation
    l_rc = platPutCfamRegister( i_target, i_address, i_data );

    if (l_rc)
    {
        FAPI_ERR("platPutCfamRegister failed - Target %s, Addr %.8X",
                  i_target.toEcmdString(), i_address);
    }

    if( l_traceit )
    {
        FAPI_SCAN( "TRACE : PUTCFAMREG  : %s : %.8X %.8X",
               i_target.toEcmdString(),
               i_address,
               i_data.getWord(0) );
    }

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:29,代码来源:fapiHwAccess.C

示例15: fapiMultiScom

fapi::ReturnCode fapiMultiScom (
                    const   fapi::Target&       i_target,
                            fapi::MultiScom&    io_multiScomObj)
{
    FAPI_DBG (ENTER_MRK "fapiMultiScom - i_target: %s, # input ops: %d",
              i_target.toEcmdString (), io_multiScomObj.iv_ScomList.size ());

    fapi::ReturnCode l_rc;

    // Call the platform specific implemetation
    l_rc = platMultiScom (i_target, io_multiScomObj);

    if (!l_rc.ok ())
    {
        uint32_t l_retCode = l_rc;

        FAPI_ERR ("fapiMultiScom Failed with RC: 0x%.8X! i_target: %s, "
                  "# input ops: %d, # ops complete: %d", l_retCode,
                  i_target.toEcmdString (),
                  io_multiScomObj.iv_ScomList.size (),
                  io_multiScomObj.iv_NumOfCompletes);
    }

    FAPI_DBG (EXIT_MRK "fapiMultiScom - i_target: %s, # input ops: %d, "
              "#ops complete: %d", i_target.toEcmdString (),
              io_multiScomObj.iv_ScomList.size (),
              io_multiScomObj.iv_NumOfCompletes);

    return l_rc;
}
开发者ID:AmesianX,项目名称:hostboot,代码行数:30,代码来源:fapiHwAccess.C


注:本文中的FAPI_ERR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。