diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2013-05-29 12:41:40 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-07-10 16:22:56 -0500 |
commit | 3837a7143776c6ea55fcda737e3425860c75a28c (patch) | |
tree | beb0237c0d0853724a05ab77adb062915a89c82a /src/include/usr/hwpf | |
parent | b035c67e8f54336b31b5586f6f92ca7aba0fa130 (diff) | |
download | talos-hostboot-3837a7143776c6ea55fcda737e3425860c75a28c.tar.gz talos-hostboot-3837a7143776c6ea55fcda737e3425860c75a28c.zip |
FAPI updates from HostServices
Change-Id: I0d8f0fb43ead61a8a37f7f9ca7be12efec09e144
RTC: 52953
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4738
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiAttributeService.H | 2 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiErrorInfo.H | 73 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCode.H | 4 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H | 62 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiUtil.H | 6 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatUtil.H | 3 |
6 files changed, 124 insertions, 26 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiAttributeService.H b/src/include/usr/hwpf/fapi/fapiAttributeService.H index 3c6b0dff4..cc98b5778 100644 --- a/src/include/usr/hwpf/fapi/fapiAttributeService.H +++ b/src/include/usr/hwpf/fapi/fapiAttributeService.H @@ -137,7 +137,7 @@ ReturnCode fapiGetInitFileAttr(const AttributeId i_id, * 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 fapiCheckIdType(AttributeId, T &) {} +template<typename T> inline void fapiCheckIdType(AttributeId, T &) {} /** * @brief Fail if attribute privileged diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H index 336552957..60c0b29f0 100644 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H @@ -133,6 +133,25 @@ public: */ uint32_t getFfdcId() {return iv_ffdcId;} +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + + private: // FFDC Identifier @@ -166,6 +185,24 @@ struct ErrorInfoProcedureCallout const ProcedureCallouts::ProcedureCallout i_procedure, const CalloutPriorities::CalloutPriority i_calloutPriority); +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + // The procedure to callout ProcedureCallouts::ProcedureCallout iv_procedure; @@ -222,6 +259,24 @@ struct ErrorInfoCDG const bool i_gard, const CalloutPriorities::CalloutPriority i_priority); +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + // The target to callout/deconfigure/GARD Target iv_target; @@ -290,6 +345,24 @@ struct ErrorInfo */ ~ErrorInfo(); +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + // Vector of FFDC Data std::vector<ErrorInfoFfdc *> iv_ffdcs; typedef std::vector<ErrorInfoFfdc *>::iterator ErrorInfoFfdcItr_t; diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H index 957aee200..08756293d 100644 --- a/src/include/usr/hwpf/fapi/fapiReturnCode.H +++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H @@ -534,7 +534,7 @@ namespace ReturnCodeFfdc * @return uint16_t. Size of the FFDC data */ template<typename T> - uint16_t getErrorInfoFfdcSize(const T &) + inline uint16_t getErrorInfoFfdcSize(const T &) { checkFfdcSize<(sizeof(T) > EI_FFDC_MAX_SIZE)>(); return sizeof(T); @@ -568,7 +568,7 @@ namespace ReturnCodeFfdc */ class Error_PtrPassedToGetErrorInfoFfdcSize; template<typename T> - int16_t getErrorInfoFfdcSize(const T *) + inline int16_t getErrorInfoFfdcSize(const T *) { Error_PtrPassedToGetErrorInfoFfdcSize(); return 0; diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H b/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H index f0a6b5146..94f04618a 100644 --- a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H +++ b/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file fapiReturnCodeDataRef.H * @@ -131,6 +131,24 @@ public: */ ErrorInfo & getCreateErrorInfo(); +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + private: /** diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H index 6b5a9e3fb..fa7728271 100644 --- a/src/include/usr/hwpf/fapi/fapiUtil.H +++ b/src/include/usr/hwpf/fapi/fapiUtil.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -70,6 +70,10 @@ #define FAPI_HTOBE64(x) FAPI_PLAT_HTOBE64(x) #define FAPI_HTOLE64(x) FAPI_PLAT_HTOLE64(x) +// Defines for platform-specific memory allocation +#define fapiMalloc(s) fapiPlatMalloc(s) +#define fapiFree(p) fapiPlatFree(p) + // It is an eCMD requirement that these functions have a "C" symbol // because they may be used from a dynamically linked shared library extern "C" diff --git a/src/include/usr/hwpf/plat/fapiPlatUtil.H b/src/include/usr/hwpf/plat/fapiPlatUtil.H index 41c2fd124..a27bc140b 100644 --- a/src/include/usr/hwpf/plat/fapiPlatUtil.H +++ b/src/include/usr/hwpf/plat/fapiPlatUtil.H @@ -39,6 +39,7 @@ #define FAPIPLATUTIL_H_ #include <endian.h> +#include <stdlib.h> // defines for endian conversion #define FAPI_PLAT_BE16TOH(x) be16toh(x) @@ -56,5 +57,7 @@ #define FAPI_PLAT_HTOBE64(x) htobe64(x) #define FAPI_PLAT_HTOLE64(x) htole64(x) +#define fapiPlatMalloc(s) malloc(s) +#define fapiPlatFree(p) free(p) #endif // FAPIPLATUTIL_H_ |