diff options
Diffstat (limited to 'src/hwpf')
-rw-r--r-- | src/hwpf/plat_target.H | 11 | ||||
-rw-r--r-- | src/hwpf/plat_utils.C | 58 | ||||
-rw-r--r-- | src/hwpf/plat_utils.H | 15 | ||||
-rw-r--r-- | src/hwpf/target.C | 19 |
4 files changed, 13 insertions, 90 deletions
diff --git a/src/hwpf/plat_target.H b/src/hwpf/plat_target.H index 534a351a..51f32629 100644 --- a/src/hwpf/plat_target.H +++ b/src/hwpf/plat_target.H @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -69,7 +70,6 @@ namespace fapi2 typedef union plat_target_handle { uint32_t value; struct { -#ifdef _BIG_ENDIAN uint32_t chiplet_num : 8; uint32_t type_target_num : 8; uint32_t present : 1; @@ -77,15 +77,6 @@ namespace fapi2 uint32_t is_multicast : 1; uint32_t valid : 1; uint32_t type : 12; -#else - uint32_t type : 12; - uint32_t valid : 1; - uint32_t is_multicast : 1; - uint32_t functional : 1; - uint32_t present : 1; - uint32_t type_target_num : 8; - uint32_t chiplet_num : 8; -#endif } fields; /// /// @brief Plat target handle constructor diff --git a/src/hwpf/plat_utils.C b/src/hwpf/plat_utils.C index 4e4024e7..ed12c2e4 100644 --- a/src/hwpf/plat_utils.C +++ b/src/hwpf/plat_utils.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -137,60 +138,3 @@ namespace fapi2 } }; -#ifndef _BIG_ENDIAN - -/// Byte-reverse a 16-bit integer if on a little-endian machine - -uint16_t -revle16(uint16_t i_x) -{ - uint16_t rx; - uint8_t *pix = (uint8_t*)(&i_x); - uint8_t *prx = (uint8_t*)(&rx); - - prx[0] = pix[1]; - prx[1] = pix[0]; - - return rx; -} - -/// Byte-reverse a 32-bit integer if on a little-endian machine - -uint32_t -revle32(uint32_t i_x) -{ - uint32_t rx; - 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]; - - 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; - 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]; - - return rx; -} -#endif - diff --git a/src/hwpf/plat_utils.H b/src/hwpf/plat_utils.H index 960aba0a..c3a8e767 100644 --- a/src/hwpf/plat_utils.H +++ b/src/hwpf/plat_utils.H @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -48,18 +49,4 @@ #ifndef BIT #define BIT(b) BITS((b), 1) #endif - -#ifdef _BIG_ENDIAN - -#define revle16(x) x -#define revle32(x) x -#define revle64(x) x - -#else - -uint16_t revle16(uint16_t i_x); -uint32_t revle32(uint32_t i_x); -uint64_t revle64(uint64_t i_x); - -#endif #endif //_PLAT_UTILS_H_ diff --git a/src/hwpf/target.C b/src/hwpf/target.C index 7287105e..8d6da3fe 100644 --- a/src/hwpf/target.C +++ b/src/hwpf/target.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -492,7 +493,7 @@ fapi_try_exit: l_beginning_offset = CHIP_TARGET_OFFSET; fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> chip_target((createPlatTargetHandle<fapi2::TARGET_TYPE_PROC_CHIP>(0))); - G_vec_targets.at(l_beginning_offset) = revle32((fapi2::plat_target_handle_t)(chip_target.get())); + G_vec_targets.at(l_beginning_offset) = (fapi2::plat_target_handle_t)(chip_target.get()); // Initialize platform attributes. Needs to be after the chip target is // created. @@ -510,7 +511,7 @@ fapi_try_exit: // via partial good attributes FAPI_TRY(plat_TargetPresent(target_name, b_present)); - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(target_name.get()); } /* @@ -527,7 +528,7 @@ fapi_try_exit: // via partial good attributes FAPI_TRY(plat_TargetPresent(l_perv, b_present)); - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(l_perv.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(l_perv.get()); } @@ -544,7 +545,7 @@ fapi_try_exit: // via partial good attributes FAPI_TRY(plat_TargetPresent(target_name, b_present)); - G_vec_targets.at(i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + G_vec_targets.at(i) = (fapi2::plat_target_handle_t)(target_name.get()); } /* @@ -560,7 +561,7 @@ fapi_try_exit: // via partial good attributes FAPI_TRY(plat_TargetPresent(l_perv, b_present)); - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(l_perv.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(l_perv.get()); } /* @@ -577,7 +578,7 @@ fapi_try_exit: // via partial good attributes FAPI_TRY(plat_TargetPresent(l_perv, b_present)); - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(l_perv.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(l_perv.get()); } /* @@ -612,7 +613,7 @@ fapi_try_exit: static_cast<plat_target_handle_t&>(target_name.operator ()()).setPresent(); static_cast<plat_target_handle_t&>(target_name.operator ()()).setFunctional(true); } - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(target_name.get()); } /* @@ -648,7 +649,7 @@ fapi_try_exit: static_cast<plat_target_handle_t&>(target_name.operator ()()).setFunctional(true); } - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(target_name.get()); } /* @@ -673,7 +674,7 @@ fapi_try_exit: static_cast<plat_target_handle_t&>(target_name.operator ()()).setFunctional(true); } - G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + G_vec_targets.at(l_beginning_offset+i) = (fapi2::plat_target_handle_t)(target_name.get()); } |