diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2012-06-11 13:10:13 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-06-15 16:13:10 -0500 |
commit | b97837c8364cb04aed2582ac58b89365c1e14875 (patch) | |
tree | f0b65f3fc8127e393363d75614a03206e99e8485 /src/usr/hwpf/ifcompiler/initRpn.C | |
parent | 62e206399932f5c8729f24f38a12fb4db58f185b (diff) | |
download | talos-hostboot-b97837c8364cb04aed2582ac58b89365c1e14875.tar.gz talos-hostboot-b97837c8364cb04aed2582ac58b89365c1e14875.zip |
SCOM Initifile: SW146714: Use two bytes to store row rpn sequence byte count.
Change-Id: I617fe3267df98a85820c789553323d431ab9c5ee
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1184
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/ifcompiler/initRpn.C')
-rwxr-xr-x | src/usr/hwpf/ifcompiler/initRpn.C | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/usr/hwpf/ifcompiler/initRpn.C b/src/usr/hwpf/ifcompiler/initRpn.C index d926e62f1..2443ae9d4 100755 --- a/src/usr/hwpf/ifcompiler/initRpn.C +++ b/src/usr/hwpf/ifcompiler/initRpn.C @@ -40,6 +40,7 @@ // camvanng 05/07/12 Support for associated target attributes // camvanng 05/22/12 Ability to do simple operations on attributes // in the scom_data column +// SW146714 camvanng 06/08/12 Use two bytes to store row rpn sequence byte count // End Change Log ********************************************************************************* /** @@ -588,7 +589,7 @@ Rpn * Rpn::merge(Rpn * i_rpn) //------------------------------------------------------------------------------------------------- // See header file for contract -void Rpn::bin_read(BINSEQ::const_iterator & bli, uint8_t i_size, Symbols * symbols) +void Rpn::bin_read(BINSEQ::const_iterator & bli, uint16_t i_size, Symbols * symbols) { if(symbols) iv_symbols = symbols; @@ -847,7 +848,8 @@ std::string Rpn::listing(const char * i_desc, const std::string & spyname, bool //------------------------------------------------------------------------------------------------- // binary version to write to file -void Rpn::bin_str(BINSEQ & o_blist, uint32_t i_num_addrs, uint32_t i_addr_num, bool i_prepend_count) +void Rpn::bin_str(BINSEQ & o_blist, uint32_t i_num_addrs, uint32_t i_addr_num, + bool i_prepend_count, bool i_one_byte_count) { BINSEQ blist; uint32_t count = 0; @@ -939,9 +941,35 @@ void Rpn::bin_str(BINSEQ & o_blist, uint32_t i_num_addrs, uint32_t i_addr_num, b } } + //std::cout << "Rpn::bit_str(): iv_rpnstack size: " << iv_rpnstack.size() << std::endl; + //std::cout << " Rpn::bit_str(): rpn byte count: " << count << std::endl; if (i_prepend_count) { - o_blist.push_back((uint8_t) count); + if (true == i_one_byte_count) + { + //Expect count <= 255 + if (0xFF < count) + { + std::ostringstream errss; + errss << "Rpn::bin_str: count " << count << " > 0xFF\n"; + throw std::invalid_argument(errss.str()); + } + + o_blist.push_back((uint8_t) count); + } + else + { + //Expect count <= 65535 + if (0xFFFF < count) + { + std::ostringstream errss; + errss << "Rpn::bin_str: count " << count << " > 0xFFFF\n"; + throw std::invalid_argument(errss.str()); + } + + o_blist.push_back((uint8_t)(count >> 8)); + o_blist.push_back((uint8_t) count); + } } o_blist.insert(o_blist.end(), blist.begin(), blist.end()); |