diff options
author | Martin Peschke <mpeschke@de.ibm.com> | 2016-05-22 17:30:35 +0200 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-14 15:14:48 -0400 |
commit | 5ad63561952a5f51d19c5637fb992b61a16b6c3e (patch) | |
tree | f3f45689745a8d35bdeab3db1f2956c1a7507236 /src | |
parent | 5006f0f763b4e3ec65443859f7e8f6ffcaa5cfd8 (diff) | |
download | talos-hostboot-5ad63561952a5f51d19c5637fb992b61a16b6c3e.tar.gz talos-hostboot-5ad63561952a5f51d19c5637fb992b61a16b6c3e.zip |
p9_infrastruct_help: cleaning up endianess conversion
Use system header endian.h routines to do endianess conversion
instead of own routines.
Change-Id: I2d433154f6bb05c69371f832f879f1c2b3cd028a
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24902
Tested-by: Jenkins Server
Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com>
Tested-by: Hostboot CI
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25619
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H b/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H index 2e1e62200..5aa1fb1c8 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H +++ b/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H @@ -41,69 +41,6 @@ const uint32_t FIXED_RING_BUF_SIZE = #define MY_DBG(_fmt_, _args_...) printf(_fmt_, ##_args_) -// Byte-reverse a 32-bit integer -inline uint32_t myRev32(const uint32_t i_x) -{ - uint32_t rx; - -#ifdef _BIG_ENDIAN - rx = i_x; -#else - 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]; -#endif - - return rx; -} - -// Byte-reverse a 64-bit integer -inline uint64_t myRev64(const uint64_t i_x) -{ - uint64_t rx; - -#ifdef _BIG_ENDIAN - rx = i_x; -#else - 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]; -#endif - - return rx; -} - - -// Byte-reverse a 16-bit integer if on an LE machine -inline uint16_t myRev16(const uint16_t i_x) -{ - uint16_t rx; - -#ifdef _BIG_ENDIAN - rx = i_x; -#else - uint8_t* pix = (uint8_t*)(&i_x); - uint8_t* prx = (uint8_t*)(&rx); - - prx[0] = pix[1]; - prx[1] = pix[0]; -#endif - - return rx; -} - // N-byte align an address, offset or size (aos) inline uint64_t myByteAlign( const uint8_t nBytes, const uint64_t aos) { |