summaryrefslogtreecommitdiffstats
path: root/hwpf/plat/src
diff options
context:
space:
mode:
authorGreg Still <stillgs@us.ibm.com>2015-06-03 07:12:31 -0500
committerDerk Rembold <rembold@de.ibm.com>2015-06-16 13:20:49 -0500
commit5e9cb6846e5860c4f82d234760c32ca561ac3854 (patch)
tree95c4e1fbde8170fb6b7c8234c107bacf718e1030 /hwpf/plat/src
parent2315a070ebd8edeaac44df5d7a2d17ad7b44f1bb (diff)
downloadtalos-sbe-5e9cb6846e5860c4f82d234760c32ca561ac3854.tar.gz
talos-sbe-5e9cb6846e5860c4f82d234760c32ca561ac3854.zip
PPE FAPI2 resync changes
- Tested SCOMs (absolute and FAPI_TRY) on GPE SIMICS without RCs to chip target OCB registers. GPE SIMICS model does not have registers in non-chip level targets. - Testing on GPE SIMICS with RCs fails with illegal addresses in thread local storage initialization - Added ./ppe/sbe/plat platform specifics - Added missing ./ppe/hwpf/plat/include files - Added missing fapi2AttributeService.H - Add PPE specific (though likely temporary) versions of buffer.H (to deal with compile errors for "units_per_bit()" to "units_per_bit" and "bit_length()" to "bit_length") and return_code.H (to include return_code_defs.H) - Add ppe/plat/include/plat_error_scope.H to deal with SBE return code tracing - Deleted old file version - Added local version of buffer.H - Move current_err to global variable (vs thread local storage); This removes #include <thread>. - Enable PK_TRACE under FAPI_* Trace macros - Added plat_attributes.H to include generated platform specific files - Added -DUSE_PK_APP_CFG to img_defs.mk Change-Id: Ice6c24a5091d3cf8eb4e4d93a0d139086126df95 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18239 Reviewed-by: Derk Rembold <rembold@de.ibm.com> Tested-by: Derk Rembold <rembold@de.ibm.com>
Diffstat (limited to 'hwpf/plat/src')
-rw-r--r--hwpf/plat/src/fapi2ppefiles.mk2
-rw-r--r--hwpf/plat/src/plat_utils.C79
2 files changed, 80 insertions, 1 deletions
diff --git a/hwpf/plat/src/fapi2ppefiles.mk b/hwpf/plat/src/fapi2ppefiles.mk
index debd93f5..1f913872 100644
--- a/hwpf/plat/src/fapi2ppefiles.mk
+++ b/hwpf/plat/src/fapi2ppefiles.mk
@@ -19,6 +19,8 @@
FAPI2-C-SOURCES += fapi2PlatAttributeService.C
+FAPI2-C-SOURCES += plat_utils.C
+
FAPI2-S-SOURCES =
diff --git a/hwpf/plat/src/plat_utils.C b/hwpf/plat/src/plat_utils.C
index bc23c4b5..18aa4444 100644
--- a/hwpf/plat/src/plat_utils.C
+++ b/hwpf/plat/src/plat_utils.C
@@ -1,3 +1,4 @@
+
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
@@ -28,6 +29,8 @@
#include <stdint.h>
#include <plat_trace.H>
#include <return_code.H>
+
+#ifndef __PPE__
#include <error_info.H>
namespace fapi2
@@ -74,7 +77,7 @@ namespace fapi2
(*i)->iv_procedure, (*i)->iv_calloutPriority);
}
- FAPI_DBG("busCallouts: %lu", ei->iv_busCallouts.size());
+e FAPI_DBG("busCallouts: %lu", ei->iv_busCallouts.size());
for( auto i = ei->iv_busCallouts.begin(); i != ei->iv_busCallouts.end();
++i )
{
@@ -133,3 +136,77 @@ namespace fapi2
return FAPI2_RC_SUCCESS;
}
};
+
+
+/// Byte-reverse a 16-bit integer if on a little-endian machine
+
+uint16_t
+revle16(uint16_t i_x)
+{
+ uint16_t rx;
+
+#ifndef _BIG_ENDIAN
+ uint8_t *pix = (uint8_t*)(&i_x);
+ uint8_t *prx = (uint8_t*)(&rx);
+
+ prx[0] = pix[1];
+ prx[1] = pix[0];
+#else
+ rx = i_x;
+#endif
+
+ return rx;
+}
+
+#endif
+
+/// Byte-reverse a 32-bit integer if on a little-endian machine
+
+uint32_t
+revle32(uint32_t i_x)
+{
+ uint32_t rx;
+
+#ifndef _BIG_ENDIAN
+ uint8_t *pix = (uint8_t*)(&i_x);
+ uint8_t *prx = (uint8_t*)(&rx);
+
+ prx[0] = pix[3];
+ prx[1] = pix[2];
+ prx[2] = pix[1];
+ prx[3] = pix[0];
+#else
+ rx = i_x;
+#endif
+
+ return rx;
+}
+
+
+/// Byte-reverse a 64-bit integer if on a little-endian machine
+
+uint64_t
+revle64(const uint64_t i_x)
+{
+ uint64_t rx;
+
+#ifndef _BIG_ENDIAN
+ uint8_t *pix = (uint8_t*)(&i_x);
+ uint8_t *prx = (uint8_t*)(&rx);
+
+ prx[0] = pix[7];
+ prx[1] = pix[6];
+ prx[2] = pix[5];
+ prx[3] = pix[4];
+ prx[4] = pix[3];
+ prx[5] = pix[2];
+ prx[6] = pix[1];
+ prx[7] = pix[0];
+#else
+ rx = i_x;
+#endif
+
+ return rx;
+}
+
+
OpenPOWER on IntegriCloud