summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/hwpf/fapi/fapiAttributeService.H2
-rw-r--r--src/include/usr/hwpf/fapi/fapiErrorInfo.H73
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCode.H4
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H62
-rw-r--r--src/include/usr/hwpf/fapi/fapiUtil.H6
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatUtil.H3
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_
OpenPOWER on IntegriCloud