diff options
author | Brian Silver <bsilver@us.ibm.com> | 2015-03-18 08:41:02 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2015-12-11 13:40:20 -0600 |
commit | 107699b434361d0b592e42b2928347b5a281b1b6 (patch) | |
tree | e757ca5df3cd676809f7be24a30a2538cb724c3e /src/import/hwpf/fapi2/include/variable_buffer.H | |
parent | 3e1eb47ac126fc9a0c7e36b57fd85b414e14d21d (diff) | |
download | talos-hostboot-107699b434361d0b592e42b2928347b5a281b1b6.tar.gz talos-hostboot-107699b434361d0b592e42b2928347b5a281b1b6.zip |
Fix flush, invert, and reverse buffer chaining
Fix flush, insert/extract invert, and reverse buffer chaining
Add thread bitset functions
Remove putScom reference - allow for (b | 0x6) as a buffer param
Add FAPI@_RC_FALSE to allow for tri-bool type operations
Change-Id: I5e07f3f2050e45bca1a6c5a21c74ac62f5b9c51d
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16539
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: James N. Klazynski <jklazyns@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Tested-by: Brian Silver <bsilver@us.ibm.com>
Diffstat (limited to 'src/import/hwpf/fapi2/include/variable_buffer.H')
-rw-r--r-- | src/import/hwpf/fapi2/include/variable_buffer.H | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/import/hwpf/fapi2/include/variable_buffer.H b/src/import/hwpf/fapi2/include/variable_buffer.H index 95183b32f..38c7a4a5c 100644 --- a/src/import/hwpf/fapi2/include/variable_buffer.H +++ b/src/import/hwpf/fapi2/include/variable_buffer.H @@ -352,6 +352,27 @@ namespace fapi2 template< bits_type SB, bits_type L = 1 > bits_type getNumBitsSet(void) const; + /// + /// @brief Set and entire buffer to X's + /// @tparam X {0,1} depending if you want to clear (0) + /// or fill (1) a buffer + /// @return buffer_base&, Useful for method chaining + /// + template< uint8_t X > + inline variable_buffer& flush(void) + { + static_assert( (X == 1) || (X == 0), "bad argument to flush" ); + (0 == X) ? bufferTraits<bits_container>::clear(this->iv_data) : bufferTraits<bits_container>::set(this->iv_data); + return *this; + } + + /// + /// @brief Invert entire buffer + /// @return buffer_base&, Useful for method chaining + /// + inline variable_buffer& invert(void) + { bufferTraits<bits_container>::invert(this->iv_data); return *this; } + ///@} /// @name Buffer Manipulation Functions |