diff options
Diffstat (limited to 'src/include/usr/hwpf/fapi/fapiAttributeService.H')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiAttributeService.H | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiAttributeService.H b/src/include/usr/hwpf/fapi/fapiAttributeService.H index 2fe5ba517..e623a2e8a 100644 --- a/src/include/usr/hwpf/fapi/fapiAttributeService.H +++ b/src/include/usr/hwpf/fapi/fapiAttributeService.H @@ -36,6 +36,7 @@ * mjjones 06/22/2011 Major updates * mjjones 09/06/2011 Remove support for strings * mjjones 09/22/2011 Fixed example + * mjjones 10/13/2011 Added fapiGetInitFileAttr */ #ifndef FAPIATTRIBUTESERVICE_H_ @@ -69,17 +70,44 @@ * attribute. */ #define FAPI_ATTR_GET(ID, PTARGET, VAL) \ - (fapi::AttributeCheck::checkIdType<fapi::ID##_Type>(fapi::ID, VAL), \ + (fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ ID##_GETMACRO(ID, PTARGET, VAL)) #define FAPI_ATTR_SET(ID, PTARGET, VAL) \ - (fapi::AttributeCheck::checkIdType<fapi::ID##_Type>(fapi::ID, VAL), \ + (fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ ID##_SETMACRO(ID, PTARGET, VAL)) namespace fapi { -namespace AttributeCheck -{ +/** + * @brief Get an InitFile attribute + * + * This function gets a copy of an attribute. In the case of an array attribute, + * The value in the specified index is retrieved. This should be used by the + * InitFile HWP only, that HWP processes a binary InitFile and therefore needs + * to read a variable ID of a variable data type. Standard HWPs should use the + * FAPI_ATTR_GET macro which automatically checks the type for correct usage. + * + * If there are ever attributes with more than 4 dimensions then this function + * will need to be updated. + * + * @param[in] i_id AttributeID + * @param[in] i_pTarget Pointer to fapi::Target (can be NULL for system) + * @param[out] o_val Reference to uint64_t where attribute value is set + * @param[in] i_arrayIndex1 If array attribute then index1 + * @param[in] i_arrayIndex2 If at least 2D array attribute then index2 + * @param[in] i_arrayIndex3 If at least 3D array attribute then index3 + * @param[in] i_arrayIndex4 If at least 4D array attribute then index4 + * + * @return ReturnCode. Zero if success + */ +ReturnCode fapiGetInitFileAttr(const AttributeId i_id, + Target * i_pTarget, + uint64_t & o_val, + const uint32_t i_arrayIndex1 = 0, + const uint32_t i_arrayIndex2 = 0, + const uint32_t i_arrayIndex3 = 0, + const uint32_t i_arrayIndex4 = 0); /** * @brief Check the ID and TYPE @@ -87,9 +115,7 @@ namespace AttributeCheck * This is called by FAPI code to check at compile time that a FAPI attribute * access is using the correct data type and a valid AttributeId */ -template<typename T> void checkIdType(AttributeId, T &) {} - -} +template<typename T> void fapiCheckIdType(AttributeId, T &) {} } |