[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / mt / mt_ss.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
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 __MTSSX__
34 #define __MTSSX__
35
36 /* mt001.301: Addition */
37 #ifdef SS_LOGGER_SUPPORT
38 /* #define __USE_POSIX */
39 #include <limits.h>
40 #include <netinet/in.h>
41 #endif /* SS_LOGGER_SUPPORT  */
42
43 /* TAPA task entry doesn't need anything extra for MTSS */
44 typedef S8              SsdTTskEntry;
45
46
47 /* System task entry */
48 typedef struct ssdSTskEntry
49 {
50    pthread_t            tId;
51    Ent                  ent;
52    Inst                 inst;
53    SLockId              lock;
54
55 #ifdef SS_MULTICORE_SUPPORT
56    uint32_t                  lwpId;
57 #endif /* SS_MULTICORE_SUPPORT */
58 } SsdSTskEntry;
59
60
61 #ifdef SS_DRVR_SUPPORT
62 /* Driver task entry */
63 typedef struct ssdDrvrTskEntry
64 {
65    Bool flag;
66
67 } SsdDrvrTskEntry;
68 #endif
69
70
71 /* timer entry--MTSS uses common timers */
72 typedef struct ssdTmrEntry
73 {
74    CmTimer              timers[TMR_DEF_MAX];
75
76 } SsdTmrEntry;
77
78
79 /* dynamic pool doesn't need anything extra for MTSS */
80 typedef S8              SsdDPoolEntry;
81
82
83 /* static pool -- information for the memory management scheme */
84 typedef S8              SsdSPoolEntry;
85
86
87 /* generic pool doesn't need anything extra for MTSS */
88 typedef S8              SsdPoolEntry;
89
90
91 /* region doesn't need anything extra for MTSS */
92 typedef S8              SsdRegionEntry;
93
94
95 /* system services control point--tick count, timer implementation,
96  *   console implementation, IS task implementation
97  */
98 typedef struct ssdOs
99 {
100    unsigned     randSeed;               /* random number generator seed */
101
102    Ticks        sysTicks;               /* elapsed system ticks */
103
104    pthread_t    tmrHdlrTID;             /* timer handler thread */
105    CmTqCp       tmrTqCp;                /* common timer control point */
106    CmTqType     tmrTq[SS_MAX_TMRS];     /* common timer queue */
107
108    sem_t        ssStarted;              /* posted when SS completes init */
109 #ifdef CONAVL
110    FILE         *conInFp;               /* console input file pointer */
111    FILE         *conOutFp;              /* console output file pointer */
112    pthread_t    conHdlrTID;             /* console handler thread ID */
113 #endif
114
115 #ifndef NOFILESYS
116    FILE         *fileOutFp;             /* output file pointer */
117 #endif
118
119 #ifdef SS_DRVR_SUPPORT
120    pthread_t    isTskHdlrTID;           /* IS task handler thread ID */
121    int          isFildes[2];            /* pipe for SSetIntPend to isTskHdlr */
122 #endif
123    Bool         sigEvnt;                /*mt010.301 Flag to check interupt signal(SIGINT)*/
124
125 } SsdOs;
126
127 /* mt018.201 - added for memory configuration */
128 typedef struct mtBktCfg
129 {
130    Size         blkSize;                /* bucket quantum size */
131    uint32_t          numBlks;                /* the total blocks in the bucket */
132 } MtBktCfg;
133
134 typedef struct mtRegCfg
135 {
136    Region       regionId;
137    uint16_t          numBkts;
138    Size         heapsize;
139    MtBktCfg     bkt[SS_MAX_POOLS_PER_REG];
140 } MtRegCfg;
141
142 typedef struct mtMemCfg
143 {
144    uint8_t           numRegions;
145    MtRegCfg     region[SS_MAX_REGS];
146 } MtMemCfg;
147
148
149 /* mt003.301 Readwrite lock additions */
150 #ifdef SS_LOCK_SUPPORT
151 typedef struct sLockInfo
152 {
153   union
154   {
155 #ifdef SS_RDWR_LOCK_SUPPORT
156    pthread_rwlock_t rdWrLockId;
157 #endif /* SS_RDWR_LOCK_SUPPORT */
158 #ifdef SS_REC_LOCK_SUPPORT
159         pthread_mutex_t  recurLock;
160 #endif /* SS_REC_LOCK_SUPPORT */
161   }l;
162 }SLockInfo;
163 #endif /* SS_LOCK_SUPPORT */
164
165 extern uint32_t gt[128];
166 #endif  /*  __MTSSX__  */
167
168
169 \f
170 /********************************************************************30**
171
172          End of file
173 **********************************************************************/