X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmt%2Fss_mem.c;h=d99e8fb6849a8ab2c8129e7f060da53dd2ea2931;hb=694adde1a08c393a8443fd5bbd4f036f5cf85403;hp=af2c6fce220d0cf3f1baa7ac06aba7365a5a171e;hpb=829bbd114f1c3dc00c1da47bca0a8207c049df3f;p=o-du%2Fl2.git diff --git a/src/mt/ss_mem.c b/src/mt/ss_mem.c index af2c6fce2..d99e8fb68 100644 --- a/src/mt/ss_mem.c +++ b/src/mt/ss_mem.c @@ -112,36 +112,32 @@ * */ #ifdef ANSI -PUBLIC S16 SRegDynRegion +S16 SRegDynRegion ( Region region, /* region ID */ SRegInfo *regInfo /* information about the region */ ) #else -PUBLIC S16 SRegDynRegion(region, regInfo) +S16 SRegDynRegion(region, regInfo) Region region; /* region ID */ SRegInfo *regInfo; /* information about the region */ #endif { S16 ret; - - TRC1(SRegDynRegion); - - #if (ERRCLASS & ERRCLS_INT_PAR) /* validate region ID */ if (region >= SS_MAX_REGS) { SSLOGERROR(ERRCLS_INT_PAR, ESS028, region, "Invalid region"); - RETVALUE(RFAILED); + return RFAILED; } /* validate region info pointer */ if (regInfo == NULLP) { SSLOGERROR(ERRCLS_INT_PAR, ESS029, ERRZERO, "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -156,7 +152,7 @@ SRegInfo *regInfo; /* information about the region */ "Could not lock region table"); #endif - RETVALUE(RFAILED); + return RFAILED; } @@ -167,7 +163,7 @@ SRegInfo *regInfo; /* information about the region */ SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); SSLOGERROR(ERRCLS_INT_PAR, ESS031, ERRZERO, "Region ID used"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -189,7 +185,7 @@ SRegInfo *regInfo; /* information about the region */ SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); - RETVALUE(ROK); + return ROK; } @@ -210,36 +206,32 @@ SRegInfo *regInfo; /* information about the region */ * */ #ifdef ANSI -PUBLIC S16 SRegRegion +S16 SRegRegion ( Region region, /* region ID */ SRegInfo *regInfo /* information about the region */ ) #else -PUBLIC S16 SRegRegion(region, regInfo) +S16 SRegRegion(region, regInfo) Region region; /* region ID */ SRegInfo *regInfo; /* information about the region */ #endif { S16 ret; - - TRC1(SRegRegion); - - #if (ERRCLASS & ERRCLS_INT_PAR) /* validate region ID */ if (region >= SS_MAX_REGS) { SSLOGERROR(ERRCLS_INT_PAR, ESS028, region, "Invalid region"); - RETVALUE(RFAILED); + return RFAILED; } /* validate region info pointer */ if (regInfo == NULLP) { SSLOGERROR(ERRCLS_INT_PAR, ESS029, ERRZERO, "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -254,7 +246,7 @@ SRegInfo *regInfo; /* information about the region */ "Could not lock region table"); #endif - RETVALUE(RFAILED); + return RFAILED; } @@ -265,7 +257,7 @@ SRegInfo *regInfo; /* information about the region */ SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); SSLOGERROR(ERRCLS_INT_PAR, ESS031, ERRZERO, "Region ID used"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -287,7 +279,7 @@ SRegInfo *regInfo; /* information about the region */ SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); - RETVALUE(ROK); + return ROK; } @@ -306,27 +298,23 @@ SRegInfo *regInfo; /* information about the region */ * */ #ifdef ANSI -PUBLIC S16 SDeregRegion +S16 SDeregRegion ( Region region /* region ID */ ) #else -PUBLIC S16 SDeregRegion(region) +S16 SDeregRegion(region) Region region; /* region ID */ #endif { S16 ret; - - TRC1(SDeregRegion); - - #if (ERRCLASS & ERRCLS_INT_PAR) /* validate region ID */ if (region >= SS_MAX_REGS) { SSLOGERROR(ERRCLS_INT_PAR, ESS032, region, "Invalid region"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -341,7 +329,7 @@ Region region; /* region ID */ "Could not lock region table"); #endif - RETVALUE(RFAILED); + return RFAILED; } @@ -351,7 +339,7 @@ Region region; /* region ID */ { SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); SSLOGERROR(ERRCLS_INT_PAR, ESS034, region, "Region not registered"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -373,7 +361,7 @@ Region region; /* region ID */ SS_RELEASE_ALL_SEMA(&osCp.regionTblSem); - RETVALUE(ROK); + return ROK; } @@ -397,7 +385,7 @@ Region region; /* region ID */ /* ss001.301: Additions */ #ifdef SS_HISTOGRAM_SUPPORT #ifdef ANSI -PUBLIC S16 SAlloc +S16 SAlloc ( Region region, /* region ID */ Size *size, /* size of block required/allocated */ @@ -408,7 +396,7 @@ U8 *fileName, U8 entId ) #else -PUBLIC S16 SAlloc(region, size, flags, ptr, line, fileName, entId) +S16 SAlloc(region, size, flags, ptr, line, fileName, entId) Region region; /* region ID */ Size *size; /* size of block required/allocated */ U32 flags; /* allocation flags */ @@ -419,7 +407,7 @@ U8 entId; #endif #else #ifdef T2K_MEM_LEAK_DBG -PUBLIC S16 SAllocNew +S16 SAllocNew ( Region region, /* region ID */ Size *size, /* size of block required/allocated */ @@ -430,7 +418,7 @@ U32 line ) #else #ifdef ANSI -PUBLIC S16 SAlloc +S16 SAlloc ( Region region, /* region ID */ Size *size, /* size of block required/allocated */ @@ -438,7 +426,7 @@ U32 flags, /* allocation flags */ Data **ptr /* filled with pointer to block */ ) #else -PUBLIC S16 SAlloc(region, size, flags, ptr) +S16 SAlloc(region, size, flags, ptr) Region region; /* region ID */ Size *size; /* size of block required/allocated */ U32 flags; /* allocation flags */ @@ -454,7 +442,6 @@ Data **ptr; /* filled with pointer to block */ #endif /* SS_HISTOGRAM_SUPPORT */ - TRC1(SAlloc); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -462,7 +449,7 @@ Data **ptr; /* filled with pointer to block */ if (region >= SS_MAX_REGS) { SSLOGERROR(ERRCLS_INT_PAR, ESS035, region, "Invalid region"); - RETVALUE(RFAILED); + return RFAILED; } #endif #ifndef XEON_SPECIFIC_CHANGES @@ -485,7 +472,7 @@ Data **ptr; /* filled with pointer to block */ "Could not lock region table"); #endif - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -501,12 +488,12 @@ Data **ptr; /* filled with pointer to block */ #if (ERRCLASS & ERRCLS_DEBUG) SSLOGERROR(ERRCLS_DEBUG, ESS037, ERRZERO, "Could not release the semaphore"); - RETVALUE(RFAILED); + return RFAILED; #endif } #endif SSLOGERROR(ERRCLS_INT_PAR, ESS038, region, "Region not registered"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ss001.301: Additions */ @@ -563,7 +550,7 @@ Data **ptr; /* filled with pointer to block */ #if (ERRCLASS & ERRCLS_DEBUG) SSLOGERROR(ERRCLS_DEBUG, ESS039, ERRZERO, "Could not release the semaphore"); - RETVALUE(RFAILED); + return RFAILED; #endif } #endif @@ -577,7 +564,7 @@ Data **ptr; /* filled with pointer to block */ } #endif /* SSI_DEBUG_LEVEL1 */ - RETVALUE(ret); + return (ret); } @@ -598,7 +585,7 @@ Data **ptr; /* filled with pointer to block */ /* ss001.301: Additions */ #ifdef SS_HISTOGRAM_SUPPORT #ifdef ANSI -PUBLIC S16 SFree +S16 SFree ( Region region, /* region ID */ Data *ptr, /* pointer to the allocated block */ @@ -608,7 +595,7 @@ U8 *fileName, U8 entId ) #else -PUBLIC S16 SFree(region, ptr, size, line, fileName, entId) +S16 SFree(region, ptr, size, line, fileName, entId) Region region; /* region ID */ Data *ptr; /* pointer to the allocated block */ Size size; /* size of block */ @@ -619,7 +606,7 @@ U8 entId; #else #ifdef ANSI #ifdef T2K_MEM_LEAK_DBG -PUBLIC S16 SFreeNew +S16 SFreeNew ( Region region, /* region ID */ Data *ptr, /* pointer to the allocated block */ @@ -628,7 +615,7 @@ char* file, U32 line ) #else -PUBLIC S16 SFree +S16 SFree ( Region region, /* region ID */ Data *ptr, /* pointer to the allocated block */ @@ -636,7 +623,7 @@ Size size /* size of block */ ) #endif #else -PUBLIC S16 SFree(region, ptr, size) +S16 SFree(region, ptr, size) Region region; /* region ID */ Data *ptr; /* pointer to the allocated block */ Size size; /* size of block */ @@ -651,7 +638,6 @@ Size size; /* size of block */ #endif /* SS_HISTOGRAM_SUPPORT */ - TRC1(SFree); /* Get the region which is assgined with this thread. The region was * stored in the osCp and is taken with respect to thread ID. This macro @@ -669,21 +655,21 @@ Size size; /* size of block */ if (region >= SS_MAX_REGS) { SSLOGERROR(ERRCLS_INT_PAR, ESS040, region, "Invalid region"); - RETVALUE(RFAILED); + return RFAILED; } /* ss021.103 - Addition to validate size and ptr */ if (size <= NULLD) { SSLOGERROR(ERRCLS_INT_PAR, ESS041, region, "Invalid size"); - RETVALUE(RFAILED); + return RFAILED; } /* validate ptr */ if (ptr == (Data *)NULLP) { SSLOGERROR(ERRCLS_INT_PAR, ESS042, region, "Invalid ptr"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -700,7 +686,7 @@ Size size; /* size of block */ "Could not lock region table"); #endif - RETVALUE(RFAILED); + return RFAILED; } #endif #if (ERRCLASS & ERRCLS_INT_PAR) @@ -714,12 +700,12 @@ Size size; /* size of block */ #if (ERRCLASS & ERRCLS_DEBUG) SSLOGERROR(ERRCLS_DEBUG, ESS044, ERRZERO, "Could not release the semaphore"); - RETVALUE(RFAILED); + return RFAILED; #endif } #endif SSLOGERROR(ERRCLS_INT_PAR, ESS045, region, "Region not registered"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -761,7 +747,7 @@ Size size; /* size of block */ #if (ERRCLASS & ERRCLS_DEBUG) SSLOGERROR(ERRCLS_DEBUG, ESS046, ERRZERO, "Could not release the semaphore"); - RETVALUE(RFAILED); + return RFAILED; #endif } #endif @@ -776,7 +762,7 @@ Size size; /* size of block */ } #endif /* SSI_DEBUG_LEVEL1 */ - RETVALUE(ret); + return (ret); } #endif /* SS_FAP */ @@ -809,12 +795,12 @@ Size size; /* size of block */ * */ #ifdef ANSI -PUBLIC S16 SHstGrmInfoShow +S16 SHstGrmInfoShow ( Ent *entId ) #else -PUBLIC S16 SHstGrmInfoShow(entId) +S16 SHstGrmInfoShow(entId) Ent *entId; #endif { @@ -831,7 +817,6 @@ Ent *entId; CmMemEntries *entry = NULLP; U32 blkSize = 0; - TRC1(SRegInfoShow); memset(tapaTsk, ENTNC, sizeof(tapaTsk)); @@ -1022,7 +1007,7 @@ Ent *entId; }/* End of for. Region Count */ - RETVALUE(ROK); + return ROK; } #endif /* SS_HISTOGRAM_SUPPORT */