diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiAttributeTank.H | 12 | ||||
-rw-r--r-- | src/include/usr/mbox/mbox_queues.H | 4 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiAttributeTank.C | 17 | ||||
-rwxr-xr-x | src/usr/hwpf/hwp/fapiTestHwpAttr.C | 7 |
4 files changed, 34 insertions, 6 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiAttributeTank.H b/src/include/usr/hwpf/fapi/fapiAttributeTank.H index 1a666e8cf..a353c5e3f 100644 --- a/src/include/usr/hwpf/fapi/fapiAttributeTank.H +++ b/src/include/usr/hwpf/fapi/fapiAttributeTank.H @@ -73,6 +73,11 @@ const uint8_t ATTR_ARRAYD_NA = 0xff; // iv_arrayDX not applicable */ struct Attribute { + /** + * @brief Constructor initializes default values + */ + Attribute(); + uint64_t iv_val; // Value of attribute. uint32_t iv_attrId; // fapi::AttributeId enum value uint32_t iv_targetType; // fapi::TargetType enum value @@ -98,6 +103,11 @@ struct AttributeChunk static const size_t MAX_CHUNK_SIZE_BYTES = 4096; static const size_t MAX_ATTRS_PER_CHUNK = MAX_CHUNK_SIZE_BYTES / sizeof(Attribute); + + /** + * @brief Constructor initializes default values + */ + AttributeChunk(); size_t iv_numAttributes; // Number of Attributes in chunk uint8_t * iv_pAttributes; // Pointer to chunk of memory }; @@ -227,7 +237,7 @@ public: * or delete[] (if NEW) each chunk's memory */ virtual void getAllAttributes( - AllocType i_allocType, + const AllocType i_allocType, std::vector<AttributeChunk> & o_attributes) const; /** diff --git a/src/include/usr/mbox/mbox_queues.H b/src/include/usr/mbox/mbox_queues.H index 65c5265d5..bb8b9e2b3 100644 --- a/src/include/usr/mbox/mbox_queues.H +++ b/src/include/usr/mbox/mbox_queues.H @@ -44,7 +44,7 @@ namespace MBOX HB_ISTEP_MSGQ = 2, HB_ATTR_SYNC_MSGQ = 3, HB_ERROR_MSGQ = 4, - HB_HWPF_ATTR_MSGQ = 5, // HWPF Attribute override/sync + HB_HWPF_ATTR_MSGQ = 6, // HWPF Attribute override/sync // Add HB services here: HB_TEST_MSGQ = 0x7FFFFFFF, @@ -57,7 +57,7 @@ namespace MBOX FSP_ERROR_MSGQ = 0x80000004, IPL_SERVICE_QUEUE = 0x80000008, // Defined by Fsp team FSP_ATTR_SYNC_MSGQ = 0x80000009, - FSP_HWPF_ATTR_MSGQ = 0x8000000a, // HWPF Attribute override/sync + FSP_HWPF_ATTR_MSGQ = 0x8000000b, // HWPF Attribute override/sync // Add FSP services here: FSP_ECHO_MSGQ = 0xFFFFFFFF, // Fake FSP for test }; diff --git a/src/usr/hwpf/fapi/fapiAttributeTank.C b/src/usr/hwpf/fapi/fapiAttributeTank.C index 20f5fc081..a2f84f68d 100644 --- a/src/usr/hwpf/fapi/fapiAttributeTank.C +++ b/src/usr/hwpf/fapi/fapiAttributeTank.C @@ -43,6 +43,21 @@ namespace fapi { //****************************************************************************** +Attribute::Attribute() : + iv_val(0), iv_attrId(0), iv_targetType(0), iv_pos(0), iv_unitPos(0), + iv_flags(0), iv_arrayD1(0), iv_arrayD2(0), iv_arrayD3(0), iv_arrayD4(0) +{ + +} + +//****************************************************************************** +AttributeChunk::AttributeChunk() : + iv_numAttributes(0), iv_pAttributes(NULL) +{ + +} + +//****************************************************************************** AttributeTank::AttributeTank() : iv_pName("AttributeTank"), iv_attributesExist(false) { @@ -249,7 +264,7 @@ bool AttributeTank::getAttribute(const fapi::AttributeId i_attrId, //****************************************************************************** void AttributeTank::getAllAttributes( - AllocType i_allocType, + const AllocType i_allocType, std::vector<AttributeChunk> & o_attributes) const { platLock(); diff --git a/src/usr/hwpf/hwp/fapiTestHwpAttr.C b/src/usr/hwpf/hwp/fapiTestHwpAttr.C index 0cee8edf5..ad01d43c0 100755 --- a/src/usr/hwpf/hwp/fapiTestHwpAttr.C +++ b/src/usr/hwpf/hwp/fapiTestHwpAttr.C @@ -997,11 +997,12 @@ fapi::ReturnCode hwpTestAttributes(fapi::Target & i_mbaTarget, if (l_pAttr[0].iv_val != 4) { FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL); - FAPI_ERR("hwpTestAttributes: Error. Got bad value (0x%llx) from tank (2.7)", + FAPI_ERR("hwpTestAttributes: Error. Got bad value (0x%016llx) from tank (2.7)", l_pAttr[0].iv_val); break; } delete [] l_attributes[0].iv_pAttributes; + l_attributes[0].iv_pAttributes = NULL; } //---------------------------------------------------------------------- @@ -1030,7 +1031,7 @@ fapi::ReturnCode hwpTestAttributes(fapi::Target & i_mbaTarget, if (l_val != 4) { FAPI_SET_HWP_ERROR(l_rc, RC_HWP_ATTR_UNIT_TEST_FAIL); - FAPI_ERR("hwpTestAttributes: Error. Got bad value (0x%llx) from tank (3.2)", + FAPI_ERR("hwpTestAttributes: Error. Got bad value (0x%016llx) from tank (3.2)", l_val); break; } @@ -1091,6 +1092,7 @@ fapi::ReturnCode hwpTestAttributes(fapi::Target & i_mbaTarget, } free (l_attributes[0].iv_pAttributes); + l_attributes[0].iv_pAttributes = NULL; } //---------------------------------------------------------------------- @@ -1182,6 +1184,7 @@ fapi::ReturnCode hwpTestAttributes(fapi::Target & i_mbaTarget, } free (l_attributes[0].iv_pAttributes); + l_attributes[0].iv_pAttributes = NULL; } } while (0); |