summaryrefslogtreecommitdiffstats
path: root/import/hwpf/fapi2/include/buffer_parameters.H
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2015-02-10 07:40:19 -0600
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2017-10-23 15:50:50 -0500
commit360ef22ccf2715d9581e78a088449e0b164d6486 (patch)
tree06b9287008f8301e4f616ae3bcb2211047fdead7 /import/hwpf/fapi2/include/buffer_parameters.H
parentac19be2005906145169cabf08d18b88c0376abae (diff)
downloadtalos-hcode-360ef22ccf2715d9581e78a088449e0b164d6486.tar.gz
talos-hcode-360ef22ccf2715d9581e78a088449e0b164d6486.zip
Error/xml parsing and FFDC classes
Change-Id: Iddc92bb876dd07efe398255d7321ac6394eb4ae9 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15966 Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Brian Silver <bsilver@us.ibm.com> Tested-by: Brian Silver <bsilver@us.ibm.com>
Diffstat (limited to 'import/hwpf/fapi2/include/buffer_parameters.H')
-rw-r--r--import/hwpf/fapi2/include/buffer_parameters.H65
1 files changed, 65 insertions, 0 deletions
diff --git a/import/hwpf/fapi2/include/buffer_parameters.H b/import/hwpf/fapi2/include/buffer_parameters.H
new file mode 100644
index 00000000..90b3db45
--- /dev/null
+++ b/import/hwpf/fapi2/include/buffer_parameters.H
@@ -0,0 +1,65 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: import/hwpf/fapi2/include/buffer_parameters.H $ */
+/* */
+/* OpenPOWER HCODE Project */
+/* */
+/* COPYRIGHT 2012,2017 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file buffer_parameters.H
+ * @brief definitions for fapi2 buffer parameter types
+ */
+
+#ifndef __FAPI2_BUFFER_PARAM__
+#define __FAPI2_BUFFER_PARAM__
+
+#include <stdint.h>
+
+namespace fapi2
+{
+ /// @cond
+ /// @brief Traits of buffer parameters - things passed in
+ /// @tparam T is the type of i_value (typically an integral type)
+ template<typename T>
+ class parameterTraits
+ {
+ public:
+ enum
+ {
+ mask = T(~0),
+ bit_length = sizeof(T) * 8,
+ byte_length = sizeof(T),
+ };
+
+ template<typename U>
+ inline static void write_element(void* i_data, T i_value, uint32_t i_offset)
+ {
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ T* ptr = (T*)i_data + (i_offset ^ ((sizeof(U) / sizeof(T)) - 1));
+#else
+ T* ptr = (T*)i_data + i_offset;
+#endif
+ *ptr = i_value;
+ }
+ };
+ /// @endcond
+};
+
+#endif
OpenPOWER on IntegriCloud