From 94f7bbb663ffeb7eb84796cc839a0fad0e5eb4bb Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Sun, 22 May 2016 17:30:35 +0200 Subject: 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 Tested-by: Hostboot CI Reviewed-by: Richard J. Knight Reviewed-by: Martin Peschke Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30302 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta --- .../p9/utils/imageProcs/p9_infrastruct_help.H | 63 ---------------------- 1 file changed, 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 43591cb5..ca8d73de 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H +++ b/src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H @@ -47,69 +47,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) { -- cgit v1.2.1