summaryrefslogtreecommitdiffstats
path: root/src/import/generic/memory/lib/spd/spd_field.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/generic/memory/lib/spd/spd_field.H')
-rw-r--r--src/import/generic/memory/lib/spd/spd_field.H79
1 files changed, 7 insertions, 72 deletions
diff --git a/src/import/generic/memory/lib/spd/spd_field.H b/src/import/generic/memory/lib/spd/spd_field.H
index 70761a2ed..03c1da7b1 100644
--- a/src/import/generic/memory/lib/spd/spd_field.H
+++ b/src/import/generic/memory/lib/spd/spd_field.H
@@ -39,6 +39,7 @@
#include <cstdint>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <generic/memory/lib/utils/mss_field.H>
namespace mss
{
@@ -46,72 +47,6 @@ namespace spd
{
///
-/// @class field_t
-/// @brief data structure for SPD byte fields
-/// @note holds byte index, start bit, and bit length of a decoded field
-///
-class field_t
-{
- private:
-
- const size_t iv_byte;
- const size_t iv_start;
- const size_t iv_length;
-
- public:
-
- // default ctor deleted
- field_t() = delete;
-
- ///
- /// @brief ctor
- /// @param[in] i_byte_index
- /// @param[in] i_start_bit
- /// @param[in] i_bit_length
- ///
- constexpr field_t(const size_t i_byte_index,
- const size_t i_start_bit,
- const size_t i_bit_length)
- : iv_byte(i_byte_index),
- iv_start(i_start_bit),
- iv_length(i_bit_length)
- {}
-
- ///
- /// @brief default dtor
- ///
- ~field_t() = default;
-
- ///
- /// @brief Byte index getter
- /// @return the byte index for this SPD field
- ///
- constexpr size_t get_byte() const
- {
- return iv_byte;
- }
-
- ///
- /// @brief Starting bit getter
- /// @return the starting bit position for this SPD field
- ///
- constexpr size_t get_start() const
- {
- return iv_start;
- }
-
- ///
- /// @brief bit length getter
- /// @return the bit length of this SPD field
- ///
- constexpr size_t get_length() const
- {
- return iv_length;
- }
-
-};// field_t
-
-///
/// @class init_fields
/// @brief Initial fields needed to know how to parse the SPD
/// @note These are preliminary fields that need to be independently
@@ -149,12 +84,12 @@ class init_fields
// 1st field: Byte number
// 2nd field: Start bit
// 3rd field: Bit length
- static constexpr field_t REVISION{1, REVISION_START, REVISION_LEN};
- static constexpr field_t DEVICE_TYPE{2, DEVICE_TYPE_START, DEVICE_TYPE_LEN};
- static constexpr field_t BASE_MODULE{3, BASE_MODULE_START, BASE_MODULE_LEN};
- static constexpr field_t HYBRID{3, HYBRID_START, HYBRID_LEN};
- static constexpr field_t HYBRID_MEDIA{3, HYBRID_MEDIA_START, HYBRID_MEDIA_LEN};
- static constexpr field_t REF_RAW_CARD{130, REF_RAW_CARD_START, REF_RAW_CARD_LEN};
+ static constexpr mss::field_t REVISION{1, REVISION_START, REVISION_LEN};
+ static constexpr mss::field_t DEVICE_TYPE{2, DEVICE_TYPE_START, DEVICE_TYPE_LEN};
+ static constexpr mss::field_t BASE_MODULE{3, BASE_MODULE_START, BASE_MODULE_LEN};
+ static constexpr mss::field_t HYBRID{3, HYBRID_START, HYBRID_LEN};
+ static constexpr mss::field_t HYBRID_MEDIA{3, HYBRID_MEDIA_START, HYBRID_MEDIA_LEN};
+ static constexpr mss::field_t REF_RAW_CARD{130, REF_RAW_CARD_START, REF_RAW_CARD_LEN};
};
///
OpenPOWER on IntegriCloud