Added code for MAC-PHY interface, DU_APP, F1AP, SCTP and CU stub
[o-du/l2.git] / src / mt / mt_ss_wl.x
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 \f
19 /********************************************************************20**
20  
21      Name:     MTSS -- implementation specific definitions
22  
23      Type:     C include file
24  
25      Desc:     Data structure definitions demanded by systems services.
26                The contents of these are for the MTSS implementation.
27  
28      File:     mt_ss.x
29  
30 *********************************************************************21*/
31
32
33 #ifndef __MTSSWLX__
34 #define __MTSSWLX__
35
36 #if 0
37 /* mt001.301: Addition */
38 #ifdef SS_LOGGER_SUPPORT 
39 /* #define __USE_POSIX */
40 #include <limits.h>
41 #include <netinet/in.h>
42 #endif /* SS_LOGGER_SUPPORT  */
43
44 /* TAPA task entry doesn't need anything extra for MTSS */
45 typedef S8              SsdTTskEntry;
46
47
48 /* System task entry */
49 typedef struct ssdSTskEntry
50 {
51    pthread_t            tId;
52    Ent                  ent;
53    Inst                 inst;
54    SLockId              lock;
55
56 #ifdef SS_MULTICORE_SUPPORT
57    U32                  lwpId;
58 #endif /* SS_MULTICORE_SUPPORT */
59 } SsdSTskEntry;
60
61
62 #ifdef SS_DRVR_SUPPORT
63 /* Driver task entry */
64 typedef struct ssdDrvrTskEntry
65 {
66    Bool flag;
67
68 } SsdDrvrTskEntry;
69 #endif
70
71
72 /* timer entry--MTSS uses common timers */
73 typedef struct ssdTmrEntry
74 {
75    CmTimer              timers[TMR_DEF_MAX];
76
77 } SsdTmrEntry;
78
79
80 /* dynamic pool doesn't need anything extra for MTSS */
81 typedef S8              SsdDPoolEntry;
82
83
84 /* static pool -- information for the memory management scheme */
85 typedef S8              SsdSPoolEntry;
86
87
88 /* generic pool doesn't need anything extra for MTSS */
89 typedef S8              SsdPoolEntry;
90
91
92 /* region doesn't need anything extra for MTSS */
93 typedef S8              SsdRegionEntry;
94
95
96 /* system services control point--tick count, timer implementation,
97  *   console implementation, IS task implementation
98  */
99 typedef struct ssdOs
100 {
101    unsigned     randSeed;               /* random number generator seed */
102
103    Ticks        sysTicks;               /* elapsed system ticks */
104
105    pthread_t    tmrHdlrTID;             /* timer handler thread */
106    CmTqCp       tmrTqCp;                /* common timer control point */
107    CmTqType     tmrTq[SS_MAX_TMRS];     /* common timer queue */
108
109    sem_t        ssStarted;              /* posted when SS completes init */
110 #ifdef CONAVL
111    FILE         *conInFp;               /* console input file pointer */
112    FILE         *conOutFp;              /* console output file pointer */
113    pthread_t    conHdlrTID;             /* console handler thread ID */
114 #endif
115
116 #ifndef NOFILESYS
117    FILE         *fileOutFp;             /* output file pointer */
118 #endif
119
120 #ifdef SS_DRVR_SUPPORT
121    pthread_t    isTskHdlrTID;           /* IS task handler thread ID */
122    int          isFildes[2];            /* pipe for SSetIntPend to isTskHdlr */
123 #endif
124    Bool         sigEvnt;                /*mt010.301 Flag to check interupt signal(SIGINT)*/
125
126 } SsdOs;
127
128 /* mt018.201 - added for memory configuration */
129 typedef struct mtBktCfg
130 {
131    Size         blkSize;                /* bucket quantum size */
132    U32          numBlks;                /* the total blocks in the bucket */
133 } MtBktCfg;
134
135 typedef struct mtRegCfg
136 {
137    Region       regionId;
138    U16          numBkts;
139    Size         heapsize;
140    MtBktCfg     bkt[SS_MAX_POOLS_PER_REG];
141 } MtRegCfg;
142
143 typedef struct mtMemCfg
144 {
145    U8           numRegions;
146    MtRegCfg     region[SS_MAX_REGS];
147 } MtMemCfg;
148
149 #endif
150
151
152
153
154 typedef struct mtDynBktCfg
155 {
156    U16          blkSetRelThreshold;       /* threshold value for releasing memory blocks */
157    U16          blkSetAcquireThreshold;   /* threshold for requesting additional memory blocks */
158 } MtDynBktCfg;
159
160 /* The number of blocks in the buckets and size of bloks must be 
161    same as the configured in mtGlobMemCfg. */
162 typedef struct mtDynRegCfg
163 {
164    Region          regionId;                  /* Region Id */
165    U16             numBkts;                   /* Number of buckets */
166    MtDynBktCfg     bkt[SS_MAX_POOLS_PER_REG]; /* Threshold value configuration for each buckets */
167 } MtDynRegCfg;
168
169 /* This structure is used to store the initial values of the configuraiton
170  * of the individual system taks regions. The number of buckets is same
171  * as of the one configured in the gloabl region */
172 typedef struct mtDynMemCfg
173 {
174    U8              numRegions;           /* Number of regions */
175    MtDynRegCfg     region[SS_MAX_REGS];  /* Configuration details of each region */
176 } MtDynMemCfg;
177
178 /* Global bucket configuration, the number of bucket, block size and the memory
179  * block set size for each bucket */
180 typedef struct mtGlobBktCfg
181 {
182    Size         blkSize;          /* bucket quantum size */
183    U32          numBlks;          /* the total blocks in the bucket */
184    U16          bucketSetSize;    /* Size of each bucket set */
185 } MtGlobBktCfg;
186
187 typedef struct mtGlobMemCfg
188 {
189    U16              numBkts;
190 #ifdef  XEON_SPECIFIC_CHANGES
191    Size             heapSize;
192 #endif   
193    MtGlobBktCfg     bkt[SS_MAX_POOLS_PER_REG];
194 }MtGlobMemCfg;
195
196
197 #if 0
198
199 /* mt003.301 Readwrite lock additions */
200 #ifdef SS_LOCK_SUPPORT
201 typedef struct sLockInfo
202 {
203   union
204   {
205 #ifdef SS_RDWR_LOCK_SUPPORT
206    pthread_rwlock_t rdWrLockId;
207 #endif /* SS_RDWR_LOCK_SUPPORT */
208 #ifdef SS_REC_LOCK_SUPPORT
209         pthread_mutex_t  recurLock;
210 #endif /* SS_REC_LOCK_SUPPORT */
211   }l;
212 }SLockInfo;
213 #endif /* SS_LOCK_SUPPORT */
214 #endif  /*  __MTSSX__  */
215 #endif
216
217 /**********************************************************************
218          End of file
219 **********************************************************************/