Searched hist:f4d5e05e (Results 1 – 2 of 2) sorted by relevance
/openbmc/intel-ipmi-oem/include/ |
H A D | storagecommands.hpp | f4d5e05e Wed Sep 22 14:58:08 CDT 2021 Johnathan Mantey <johnathanx.mantey@intel.com> Guarantee SDR Type12 byte alignment matches the IPMI spec The Type12 structure used a uint24_t to assign storage for 3 reserved bytes in the Type12 SDR definition. This turned out to be an issue as the compiler promoted the uint24_t to a uint32_t, which added one additional byte to the structure. This in turn pushed the trailing bytes out of alignment. The defintion has been changed to use an explicit uint8_t array that is three bytes in size. This defines the structure in a way that guarantees the size of the record is correct. The structure has also had a constructor added to it to eliminate code duplication, and to reduce the likelihood of errors caused by manual calculation of values. Tested: Issued 'ipmitool sdr dump /tmp/sdrs.bin' Performed a hex dump on the binary data and reviewed the Type12 records. Confirmed all fields were correctly assigned, including the inclusion of only 3 reserved bytes. Change-Id: I3fef5a1fe67877e5a6cf6e7928c5f15599bfb6f6 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
/openbmc/intel-ipmi-oem/src/ |
H A D | storagecommands.cpp | f4d5e05e Wed Sep 22 14:58:08 CDT 2021 Johnathan Mantey <johnathanx.mantey@intel.com> Guarantee SDR Type12 byte alignment matches the IPMI spec The Type12 structure used a uint24_t to assign storage for 3 reserved bytes in the Type12 SDR definition. This turned out to be an issue as the compiler promoted the uint24_t to a uint32_t, which added one additional byte to the structure. This in turn pushed the trailing bytes out of alignment. The defintion has been changed to use an explicit uint8_t array that is three bytes in size. This defines the structure in a way that guarantees the size of the record is correct. The structure has also had a constructor added to it to eliminate code duplication, and to reduce the likelihood of errors caused by manual calculation of values. Tested: Issued 'ipmitool sdr dump /tmp/sdrs.bin' Performed a hex dump on the binary data and reviewed the Type12 records. Confirmed all fields were correctly assigned, including the inclusion of only 3 reserved bytes. Change-Id: I3fef5a1fe67877e5a6cf6e7928c5f15599bfb6f6 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|