1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* Utility definitions to be used in du app */
21 /* Memory related configs */
22 #define DU_APP_MEM_REGION 0
23 #define RLC_UL_MEM_REGION 1
24 #define RLC_DL_MEM_REGION 4
25 #define MAC_MEM_REGION 4
31 /* allocate and zero out a static buffer */
32 #define DU_ALLOC(_datPtr, _size) \
35 _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \
36 (Data **)&_datPtr, _size); \
38 cmMemset((U8*)_datPtr, 0, _size); \
43 /* free a static buffer */
44 #define DU_FREE(_datPtr, _size) \
46 SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \
47 (Data *)_datPtr, _size);
49 /* Allocate shared memory to be used for LWLC
50 * during inter-layer communication */
51 #define DU_ALLOC_SHRABL_BUF(_buf, _size) \
53 if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \
54 (Data **)&_buf, (Size) _size, 0) == ROK) \
56 cmMemset((U8 *)(_buf), 0, _size); \
64 /* Free shared memory, received through LWLC */
65 #define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
69 (Void) SPutStaticBuffer(_region, _pool, \
70 (Data *) _buf, (Size) _size, 0); \
75 /* Fill Pst structure for sending msg from DU APP to MAC */
76 #define FILL_PST_DUAPP_TO_MAC(_pst, _event) \
78 _pst.selector = ODU_SELECTOR_LWLC; \
79 _pst.srcEnt = ENTDUAPP; \
80 _pst.dstEnt = ENTRG; \
83 _pst.dstProcId = DU_PROC; \
84 _pst.srcProcId = DU_PROC; \
85 _pst.region = DU_APP_MEM_REGION; \
86 _pst.pool = DU_POOL; \
87 _pst.event = _event; \
93 /**********************************************************************
95 **********************************************************************/