Skip to content

Commit

Permalink
Update RAS DQ Inject tool with new MCHP squence
Browse files Browse the repository at this point in the history
Change-Id: I6879b8c200428c0e67ab8653d4572376542689c7
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/92260
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/92269
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
  • Loading branch information
markypizz authored and RAJA DAS committed Mar 10, 2020
1 parent d669849 commit 2d51dbb
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions src/import/hwpf/fapi2/include/variable_buffer.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -466,6 +466,25 @@ class variable_buffer
return rc;
}

///
/// @brief Write a bit in variable buffer to a given value
/// @param[in] i_value the value to write
/// @param[in] i_bit the bit number to set.
/// @param[in] i_count the count of bits to set, defaults to 1
/// @return FAPI2_RC_SUCCESS if OK
///
inline fapi2::ReturnCodes writeBit(const bool i_value,
const bits_type& i_bit,
const bits_type& i_count = 1)
{
if(i_value == 0)
{
return clearBit(i_bit, i_count);
}

return setBit(i_bit, i_count);
}

///
/// @brief invert a bit or range of bits in a buffer
/// @tparam SB Start bit in buffer to invert.
Expand Down Expand Up @@ -507,9 +526,6 @@ class variable_buffer
/// @brief Get the value of a bit in the buffer
/// @tparam B Bit in buffer to get.
/// @return true/1 if bit is on, false/0 if bit is off
/// @note Asserting that all the parameters are known at
/// compile time so this can be templated only. If that is not
/// the case we can add a function parameter version.
///
template< bits_type B >
inline bool getBit(void) const
Expand All @@ -520,6 +536,19 @@ class variable_buffer
return iv_data[index] & mask;
}

///
/// @brief Get the value of a bit in the buffer (function parameter version)
/// @param[in] i_bit bit to check
/// @return true/1 if bit is on, false/0 if bit is off
///
inline bool getBit(bits_type i_bit) const
{
const bits_type index = i_bit / bits_per_unit;
const unit_type mask = unit_type(1) <<
((bits_per_unit - 1) - (i_bit - (index * bits_per_unit)));
return iv_data[index] & mask;
}

///
/// @brief Test if multiple bits are set
/// @param SB Start bit in buffer to test.
Expand Down

0 comments on commit 2d51dbb

Please sign in to comment.