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 *******************************************************************************/
18 #ifndef __COMMON_DEF_H__
19 #define __COMMON_DEF_H__
44 #include "gen.x" /* general */
45 #include "ssi.x" /* system services */
58 #define MAX_NUM_CELL 1
62 /* 5G ORAN phy delay */
66 #define ODU_SELECTOR_LC 0
67 #define ODU_SELECTOR_TC 1
68 #define ODU_SELECTOR_LWLC 2
70 #define ODU_START_CRNTI 100
71 #define ODU_END_CRNTI 500
78 #define MIN_DRB_LCID 4
79 #define MAX_DRB_LCID 32
81 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
83 /* Defining macros for common utility functions */
84 #define ODU_GET_MSG_BUF SGetMsg
85 #define ODU_PUT_MSG_BUF SPutMsg
86 #define ODU_ADD_PRE_MSG_MULT SAddPreMsgMult
87 #define ODU_ADD_PRE_MSG_MULT_IN_ORDER SAddPreMsgMultInOrder
88 #define ODU_ADD_POST_MSG_MULT SAddPstMsgMult
89 #define ODU_START_TASK SStartTask
90 #define ODU_STOP_TASK SStopTask
91 #define ODU_ATTACH_TTSK SAttachTTsk
92 #define ODU_POST_TASK SPstTsk
93 #define ODU_COPY_MSG_TO_FIX_BUF SCpyMsgFix
94 #define ODU_COPY_FIX_BUF_TO_MSG SCpyFixMsg
95 #define ODU_REG_TTSK SRegTTsk
96 #define ODU_SET_PROC_ID SSetProcId
97 #define ODU_GET_MSG_LEN SFndLenMsg
98 #define ODU_EXIT_TASK SExitTsk
99 #define ODU_PRINT_MSG SPrntMsg
100 #define ODU_REM_PRE_MSG SRemPreMsg
101 #define ODU_REM_PRE_MSG_MULT SRemPreMsgMult
102 #define ODU_REG_TMR_MT SRegTmrMt
103 #define ODU_SEGMENT_MSG SSegMsg
104 #define ODU_CAT_MSG SCatMsg
105 #define ODU_GET_PROCID SFndProcId
106 #define ODU_SET_THREAD_AFFINITY SSetAffinity
107 #define ODU_CREATE_TASK SCreateSTsk
109 #define GET_UE_IDX( _crnti,_ueIdx) \
111 _ueIdx = _crnti - ODU_START_CRNTI + 1; \
114 #define GET_CRNTI( _crnti,_ueIdx) \
116 _crnti = _ueIdx + ODU_START_CRNTI - 1; \
119 /* Calculates cellIdx from cellId */
120 #define GET_CELL_IDX(_cellId, _cellIdx) \
122 _cellIdx = _cellId - 1; \
125 #define SET_BITS_MSB(_startBit, _numBits, _byte) \
127 _byte = (~((0xFF) >> _numBits)); \
128 _byte >>= _startBit; \
131 #define SET_BITS_LSB(_startBit, _numBits, _byte) \
133 _byte = (~((0xFF) << _numBits)); \
134 _byte <<= _startBit; \
137 /* this MACRO set 1 bit at the bit position */
138 #define SET_ONE_BIT(_bitPos, _out) \
140 _out = ((1<<_bitPos) | _out); \
143 /* this MACRO un-set 1 bit at the bit position */
144 #define UNSET_ONE_BIT(_bitPos, _out) \
146 _out = (~(1<<_bitPos) & _out); \
149 /* this MACRO finds the index of the rightmost set bit */
150 #define GET_RIGHT_MOST_SET_BIT( _in,_bitPos) \
152 _bitPos = __builtin_ctz(_in); \
155 typedef struct slotIndInfo
162 typedef struct PlmnIdentity
183 void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain);
184 void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len);
185 uint8_t buildPlmnId(Plmn plmn, uint8_t *buf);
189 /**********************************************************************
191 ***********************************************************************/