summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2016-05-27 07:56:45 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-07-01 10:18:24 -0400
commit82e972c8847a3cfe63120c94b47c7e2e7842ae14 (patch)
treed0c4a239ee70efe08494ecdfa6acb3844754f238 /src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
parente0c75d46e562ced7d24dddafc833c6bb22057820 (diff)
downloadtalos-hostboot-82e972c8847a3cfe63120c94b47c7e2e7842ae14.tar.gz
talos-hostboot-82e972c8847a3cfe63120c94b47c7e2e7842ae14.zip
PM:Changing calling convention of STOP API.
Changes made in function arguments to make it suitable for C world. This is based on feedback received from Power Mixer team. RTC:154530 Change-Id: I402822918089df2ac05774ede1e770bd013678b3 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25143 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25144 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C')
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
index 4eaf9edfa..bf5b3ea7b 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
+++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
@@ -30,18 +30,21 @@
#include "p9_stop_api.H"
#include "p9_stop_util.H"
#include "p9_stop_data_struct.H"
+
+#ifdef __cplusplus
namespace stopImageSection
{
+#endif
/**
* @brief Returns proc chip's fuse mode status.
* @param i_pImage points to start of chip's HOMER image.
- * @param o_fuseMode true if system is in fuse mode, false otherwise.
+ * @param o_fuseMode points to fuse mode information.
* @return STOP_SAVE_SUCCESS if functions succeeds, error code otherwise.
*/
-StopReturnCode_t isFusedMode( void* const i_pImage, bool& o_fuseMode )
+StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fuseMode )
{
- o_fuseMode = false;
+ *o_fuseMode = false;
StopReturnCode_t l_rc = STOP_SAVE_SUCCESS;
do
@@ -66,7 +69,7 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool& o_fuseMode )
if( (uint8_t) FUSE_MODE == pHomer->fuseModeStatus )
{
- o_fuseMode = true;
+ *o_fuseMode = true;
break;
}
@@ -88,7 +91,7 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool& o_fuseMode )
//----------------------------------------------------------------------
StopReturnCode_t getCoreAndThread( void* const i_pImage, const uint64_t i_pir,
- uint32_t& o_coreId, uint32_t& o_threadId )
+ uint32_t* o_pCoreId, uint32_t* o_pThreadId )
{
StopReturnCode_t l_rc = STOP_SAVE_SUCCESS;
@@ -103,9 +106,9 @@ StopReturnCode_t getCoreAndThread( void* const i_pImage, const uint64_t i_pir,
// whereas b30 and b31 gives logical and virtual thread id.
bool fuseMode = false;
uint8_t coreThreadInfo = (uint8_t)i_pir;
- o_coreId = 0;
- o_threadId = 0;
- l_rc = isFusedMode( i_pImage, fuseMode );
+ *o_pCoreId = 0;
+ *o_pThreadId = 0;
+ l_rc = isFusedMode( i_pImage, &fuseMode );
if( l_rc )
{
@@ -117,56 +120,56 @@ StopReturnCode_t getCoreAndThread( void* const i_pImage, const uint64_t i_pir,
{
if( coreThreadInfo & FUSE_BIT1 )
{
- o_threadId = 2;
+ *o_pThreadId = 2;
}
if( coreThreadInfo & FUSE_BIT2 )
{
- o_threadId += 1;
+ *o_pThreadId += 1;
}
if( coreThreadInfo & FUSE_BIT0 )
{
- o_coreId = 2;
+ *o_pCoreId = 2;
}
if( coreThreadInfo & FUSE_BIT3 )
{
- o_coreId += 1;
+ *o_pCoreId += 1;
}
}
else
{
if( coreThreadInfo & FUSE_BIT0 )
{
- o_coreId = 2;
+ *o_pCoreId = 2;
}
if ( coreThreadInfo & FUSE_BIT1 )
{
- o_coreId += 1;
+ *o_pCoreId += 1;
}
if( coreThreadInfo & FUSE_BIT2 )
{
- o_threadId = 2;
+ *o_pThreadId = 2;
}
if( coreThreadInfo & FUSE_BIT3 )
{
- o_threadId += 1;
+ *o_pThreadId += 1;
}
-
-
}
//quad field is not affected by fuse mode
- o_coreId += 4 * (( coreThreadInfo & 0x70 ) >> 4 );
-
+ *o_pCoreId += 4 * (( coreThreadInfo & 0x70 ) >> 4 );
}
while(0);
return l_rc;
}
+#ifdef __cplusplus
}//namespace stopImageSection ends
+#endif
+
OpenPOWER on IntegriCloud