X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fcm%2Fcommon_def.c;h=00b61dc13bdac0712735a4dc3f071573f6f0b380;hb=56db1b2ff587365594f48f3274f806180eda4cb2;hp=9d992466fa02eddfb2d8bb4351c216c07559f4b0;hpb=13d69430713cd381772de495739acff114be7e2a;p=o-du%2Fl2.git diff --git a/src/cm/common_def.c b/src/cm/common_def.c index 9d992466f..00b61dc13 100644 --- a/src/cm/common_def.c +++ b/src/cm/common_def.c @@ -140,7 +140,128 @@ uint8_t buildPlmnId(Plmn plmn, uint8_t *buf) return ROK; } +/******************************************************************* +* +* @brief SGetSBuf with debug logs +* +* @details +* +* Function : SGetSBufNewForDebug +* +* Functionality: SGetSBuf with debug logs +* +* @params[in] file name, fun name, region, pool, data ptr, size +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data **ptr, Size size) +{ + if(SGetSBuf(region, pool, ptr, size) == ROK) + { +#ifdef ODU_MEMORY_DEBUG_LOG + printf("\nCM_ALLOC=== SGetSBufNewForDebug %s +%d, %s, %d, %p\n",\ + file, line, func, size, *ptr); +#endif + return ROK; + } + else + return RFAILED; +} + +/******************************************************************* +* +* @brief SPutSBuf with debug logs +* +* @details +* +* Function : SPutSBufNewForDebug +* +* Functionality: SPutSBuf with debug logs +* +* @params[in] file name, fun name, region, pool, data ptr, size +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data *ptr, Size size) +{ + if(SPutSBuf(region, pool, ptr, size) == ROK) + { +#ifdef ODU_MEMORY_DEBUG_LOG + printf("\nCM_FREE=== SPutSBufNewForDebug %s +%d, %s, %d, %p\n",\ + file, line, func, size, ptr); +#endif + return ROK; + } + else + return RFAILED; +} + +/******************************************************************* +* +* @brief SGetStaticBuf with debug logs +* +* @details +* +* Function : SGetStaticBufNewForDebug +* +* Functionality: SGetStaticBuf with debug logs +* +* @params[in] file name, fun name, region, pool, data ptr, size, memType +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t SGetStaticBufNewForDebug(char *file, char *func, char *line, \ +Region region, Pool pool, Data **ptr, Size size, uint8_t memType) +{ + if(SGetStaticBuffer(region, pool, ptr, size, memType) == ROK) + { +#ifdef ODU_MEMORY_DEBUG_LOG + printf("\nCM_ALLOC=== SGetStaticBufNewForDebug %s +%d, %s, %d, %p\n",\ + file, line, func, size, *ptr); +#endif + return ROK; + } + else + return RFAILED; +} + +/******************************************************************* +* +* @brief SPutStaticBuf with debug logs +* +* @details +* +* Function : SPutStaticBufNewForDebug +* +* Functionality: SPutStaticBuf with debug logs +* +* @params[in] file name, fun name, region, pool, data ptr, size, memType +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t SPutStaticBufNewForDebug(char *file, char *func, char *line, \ +Region region, Pool pool, Data *ptr, Size size, uint8_t memType) +{ + if(SPutStaticBuffer(region, pool, ptr, size, memType) == ROK) + { +#ifdef ODU_MEMORY_DEBUG_LOG + printf("\nCM_FREE=== SPutStaticBufNewForDebug %s +%d, %s, %d, %p\n",\ + file, line, func, size, ptr); +#endif + return ROK; + } + else + return RFAILED; +} /********************************************************************** End of file **********************************************************************/