summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf/fapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/hwpf/fapi')
-rw-r--r--src/include/usr/hwpf/fapi/fapiAttributeService.H40
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCodes.H3
2 files changed, 35 insertions, 8 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 &) {}
}
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodes.H b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
index 3c31a72c0..438f768c8 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCodes.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
@@ -35,7 +35,7 @@
* mjjones 06/30/2011 Add FAPI_RC_ATTR_UNIT_TEST_FAIL
* mjjones 08/10/2011 Add FAPI_RC_FFDC_HWP_NOT_FOUND
* mjjones 09/23/2011 Remove FAPI_RC_FFDC_HWP_NOT_FOUND
- *
+ * mjjones 10/07/2011 Add FAPI_RC_INVALID_ATTR_GET
*/
#ifndef FAPIRETURNCODES_H_
@@ -62,6 +62,7 @@ enum
// FAPI generated return codes
FAPI_RC_NOT_IMPLEMENTED = FAPI_RC_FAPI_MASK | 0x01,
FAPI_RC_ATTR_UNIT_TEST_FAIL = FAPI_RC_FAPI_MASK | 0x02,
+ FAPI_RC_INVALID_ATTR_GET = FAPI_RC_FAPI_MASK | 0x03,
// PLAT generated return codes
FAPI_RC_PLAT_ERR_SEE_DATA = FAPI_RC_PLAT_MASK | 0x01,
OpenPOWER on IntegriCloud