X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg.h;fp=src%2F5gnrmac%2Frg.h;h=2c039006606a844f31190298ad3d6d68dee9d871;hb=069ae37558afd5aee2d1072bbf5b517cf665bdd8;hp=545aaf2f3ffac1f16d5bf057281c61fd244c35e4;hpb=8b3c1a54b33c87e09512690649ed24775f7a5508;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg.h b/src/5gnrmac/rg.h index 545aaf2f3..2c0390066 100755 --- a/src/5gnrmac/rg.h +++ b/src/5gnrmac/rg.h @@ -244,7 +244,7 @@ U32 macHeader[2]; #define RG_MAX_DL_HARQ_NUM 8 #endif -#define MAC_MEM_REGION 4 +#define MAC_MEM_REGION 4 #define MAC_POOL 1 /* allocate and zero out a MAC static buffer */ #define MAC_ALLOC(_datPtr, _size) \ @@ -264,6 +264,32 @@ U32 macHeader[2]; SPutSBuf(MAC_MEM_REGION, MAC_POOL, \ (Data *)_datPtr, _size); +/* Allocate shared memory to be used for LWLC + * during inter-layer communication */ +#define MAC_ALLOC_SHRABL_BUF(_buf, _size) \ +{ \ + if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \ + (Data **)&_buf, (Size) _size, 0) == ROK) \ + { \ + cmMemset((U8 *)(_buf), 0, _size); \ + } \ + else \ + { \ + (_buf) = NULLP; \ + } \ +} + +/* Free shared memory, received through LWLC */ +#define MAC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \ +{ \ + if (_buf != NULLP) \ + { \ + (Void) SPutStaticBuffer(_region, _pool, \ + (Data *) _buf, (Size) _size, 0); \ + _buf = NULLP; \ + } \ +} + /* Free shared memory, received through LWLC */ #define MAC_FREE_MEM(_region, _pool, _datPtr, _size) \ if(_datPtr) \