summaryrefslogtreecommitdiffstats
path: root/src/occ_gpe0/firdata/ecc.c
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2017-07-16 09:53:32 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-07-21 16:26:29 -0400
commitcbedccff001c94de84fdc01d1ea8a38a8264598e (patch)
treee9b1ebae6fa2d95d4a9c0aea586888431d21ce7f /src/occ_gpe0/firdata/ecc.c
parentf301809e56b82fe61260a15f437183976db9ef75 (diff)
downloadtalos-occ-cbedccff001c94de84fdc01d1ea8a38a8264598e.tar.gz
talos-occ-cbedccff001c94de84fdc01d1ea8a38a8264598e.zip
rt_xstop_analysis: compile all of firdata on gpe0
Change-Id: I804cdf63879a2b80c9e14149e45ee665240c4a88 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43244 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_gpe0/firdata/ecc.c')
-rw-r--r--src/occ_gpe0/firdata/ecc.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/occ_gpe0/firdata/ecc.c b/src/occ_gpe0/firdata/ecc.c
index 6696678..8e54af4 100644
--- a/src/occ_gpe0/firdata/ecc.c
+++ b/src/occ_gpe0/firdata/ecc.c
@@ -23,10 +23,6 @@
/* */
/* IBM_PROLOG_END_TAG */
-/*#include <stdio.h> */
-#include <endian.h>
-#include <assert.h>
-
#include <native.h>
#include <ecc.h>
@@ -127,7 +123,7 @@ static uint8_t syndromeMatrix[] = {
uint8_t parity_check( uint64_t i_data )
{
int ones = 0;
- size_t x;
+ uint32_t x;
for( x=0; x<(sizeof(i_data)*8); x++ )
{
if( i_data & (0x8000000000000000ull >> x) )
@@ -203,13 +199,16 @@ uint8_t correctECC(uint64_t* io_data, uint8_t* io_ecc)
}
void injectECC(const uint8_t* i_src,
- size_t i_srcSz,
+ uint32_t i_srcSz,
uint8_t* o_dst)
{
- assert(0 == (i_srcSz % sizeof(uint64_t)));
+ if (0 != (i_srcSz % sizeof(uint64_t)))
+ {
+ return;
+ }
- size_t i = 0;
- size_t o = 0;
+ uint32_t i = 0;
+ uint32_t o = 0;
for(i = 0, o = 0;
i < i_srcSz;
i += sizeof(uint64_t), o += sizeof(uint64_t) + sizeof(uint8_t))
@@ -226,13 +225,16 @@ void injectECC(const uint8_t* i_src,
}
eccStatus removeECC(uint8_t* io_src,
- uint8_t* o_dst, size_t i_dstSz)
+ uint8_t* o_dst, uint32_t i_dstSz)
{
- assert(0 == (i_dstSz % sizeof(uint64_t)));
+ if (0 != (i_dstSz % sizeof(uint64_t)))
+ {
+ return -1;
+ }
eccStatus rc = ECC_CLEAN;
- size_t i = 0, o = 0;
+ uint32_t i = 0, o = 0;
for(i = 0, o = 0;
o < i_dstSz;
i += sizeof(uint64_t) + sizeof(uint8_t), o += sizeof(uint64_t))
OpenPOWER on IntegriCloud