X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_utils.h;h=98f0338996aef76f708189073666847c1b6c97f9;hb=fc7d3ce9647a7da04f5a67fa34419076069defc1;hp=7146dc3c29661dff43e015750dbd52c9705e4d89;hpb=9c8b78da0f4ef42dae5e30a3061463b81327e7a0;p=o-du%2Fl2.git diff --git a/src/du_app/du_utils.h b/src/du_app/du_utils.h index 7146dc3c2..98f033899 100644 --- a/src/du_app/du_utils.h +++ b/src/du_app/du_utils.h @@ -27,6 +27,7 @@ #define DU_POOL 1 #define RLC_POOL 1 #define MAC_POOL 1 +#define MAX_SLIV_CONFIG_IDX 105 /* Events */ #define EVTCFG 0 @@ -42,30 +43,62 @@ #define EVENT_RIC_DATA 10 /* allocate and zero out a static buffer */ + +#ifdef MEM_SIZE_CHECK +#define DU_APP_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) \ +{\ + DU_LOG("\n DUAPP line = %d, func = %s, _size= %d ", _line, _func, _size); \ +} +#else +#define DU_APP_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) {} +#endif + + +#ifdef ODU_MEMORY_DEBUG_LOG +#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ +{\ + printf("\n%s,=== %s +%d, %s, %lu, %p \n", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ +} +#else +#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} +#endif + #define DU_ALLOC(_datPtr, _size) \ { \ + DU_APP_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ int _ret; \ _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \ (Data **)&_datPtr, _size); \ - if(_ret == ROK) \ + if(_ret == ROK) \ + {\ + DU_MEM_LOG("DU,ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ memset(_datPtr, 0, _size); \ + }\ else \ _datPtr = NULLP; \ } /* free a static buffer */ #define DU_FREE(_datPtr, _size) \ - if(_datPtr) \ +{ \ + if(_datPtr != NULLP) \ + { \ + DU_MEM_LOG("DU,FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \ - (Data *)_datPtr, _size); - + (Data *)_datPtr, _size); \ + _datPtr = NULLP; \ + } \ +} /* Allocate shared memory to be used for LWLC * during inter-layer communication */ #define DU_ALLOC_SHRABL_BUF(_buf, _size) \ { \ + DU_APP_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \ (Data **)&_buf, (Size) _size, 0) == ROK) \ { \ + DU_MEM_LOG("DU,ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ memset((_buf), 0, _size); \ } \ else \ @@ -79,6 +112,7 @@ { \ if (_buf != NULLP) \ { \ + DU_MEM_LOG("DU,FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ (Void) SPutStaticBuffer(_region, _pool, \ (Data *) _buf, (Size) _size, 0); \ _buf = NULLP; \ @@ -121,6 +155,18 @@ _pst.intfVer = 0; \ } + +void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg *puschCfg); +uint8_t duAddNodeToLList(CmLListCp *llist, void *blockToAdd, CmLList *currNode); +uint8_t duDelNodeFromLList(CmLListCp *llist, CmLList *node); + +DuPagUeRecord* handlePageUeLL(uint16_t pagUeId, uint64_t sTmsi, CmLListCp *pageUeLL, ActionTypeLL action); +DuPagUeList* handlePageInfoLL(uint16_t pf, uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action); +DuPagInfoList* findPagingInfoFromMap(uint16_t pf, CmHashListCp *pagingInfoMap); +#if 0 +void printPageList(CmHashListCp *pagingInfoMap); +#endif + /********************************************************************** End of file **********************************************************************/