Slot indication from MAC to DU APP : LWLC fix and LC
[o-du/l2.git] / src / 5gnrmac / rg.h
index 545aaf2..2c03900 100755 (executable)
@@ -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)                                               \