From bed103fa4c741d2c22764e45e496b3af5ea104ac Mon Sep 17 00:00:00 2001 From: spashabk-in Date: Thu, 9 Mar 2017 01:20:04 -0600 Subject: Consolidating globals in SBE Overall an increase in size of 88bytes Change-Id: I975ec1536bc2d8153772133d26f750688a849a70 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37714 Reviewed-by: Sachin Gupta Tested-by: Jenkins Server Tested-by: FSP CI Jenkins --- src/sbefw/sbecmdCntrlTimer.C | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/sbefw/sbecmdCntrlTimer.C') diff --git a/src/sbefw/sbecmdCntrlTimer.C b/src/sbefw/sbecmdCntrlTimer.C index 62324979..db07076a 100644 --- a/src/sbefw/sbecmdCntrlTimer.C +++ b/src/sbefw/sbecmdCntrlTimer.C @@ -36,6 +36,7 @@ #include "sbeHostMsg.H" #include "sbeHostUtils.H" #include "sbeTimerSvc.H" +#include "sbeglobals.H" #include "fapi2.H" using namespace fapi2; @@ -78,7 +79,7 @@ uint32_t sbeCntrlTimer( uint8_t *i_pArg ) do { - if(g_sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_START_TIMER) + if(SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_START_TIMER) { uint64_t time = 0; l_rc = sbeReadPsu2SbeMbxReg(SBE_HOST_PSU_MBOX_REG1, @@ -98,7 +99,7 @@ uint32_t sbeCntrlTimer( uint8_t *i_pArg ) (PkTimerCallback)&sbeTimerExpiryCallback); if(SBE_SEC_OPERATION_SUCCESSFUL != l_rc) { - g_sbeSbe2PsuRespHdr.setStatus(SBE_PRI_INTERNAL_ERROR, l_rc); + SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_INTERNAL_ERROR, l_rc); SBE_ERROR(SBE_FUNC" g_hostTimerSvc.startTimer failed"); l_rc = SBE_SEC_OPERATION_SUCCESSFUL; break; @@ -114,13 +115,13 @@ uint32_t sbeCntrlTimer( uint8_t *i_pArg ) break; } - if(g_sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_STOP_TIMER) + if(SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_STOP_TIMER) { SBE_INFO(SBE_FUNC "Stop Timer."); l_rc = g_hostTimerSvc.stopTimer( ); if(SBE_SEC_OPERATION_SUCCESSFUL != l_rc) { - g_sbeSbe2PsuRespHdr.setStatus(SBE_PRI_INTERNAL_ERROR, l_rc); + SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_INTERNAL_ERROR, l_rc); SBE_ERROR(SBE_FUNC" g_hostTimerSvc.stopTimer failed"); l_rc = SBE_SEC_OPERATION_SUCCESSFUL; break; @@ -128,14 +129,14 @@ uint32_t sbeCntrlTimer( uint8_t *i_pArg ) break; } - g_sbeSbe2PsuRespHdr.setStatus( SBE_PRI_INVALID_COMMAND, + SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus( SBE_PRI_INVALID_COMMAND, SBE_SEC_COMMAND_NOT_SUPPORTED); SBE_ERROR(SBE_FUNC" Not a valid flag 0x%4X", - (uint16_t) g_sbePsu2SbeCmdReqHdr.flags); + (uint16_t) SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags); }while(0); // Send the response - sbePSUSendResponse(g_sbeSbe2PsuRespHdr, l_fapiRc, l_rc); + sbePSUSendResponse(SBE_GLOBAL->sbeSbe2PsuRespHdr, l_fapiRc, l_rc); SBE_EXIT(SBE_FUNC); return l_rc; -- cgit v1.2.1