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 /********************************************************************20**
21 Name: MTSS -- implementation specific definitions
25 Desc: Data structure definitions demanded by systems services.
26 The contents of these are for the MTSS implementation.
30 *********************************************************************21*/
37 /* mt001.301: Addition */
38 #ifdef SS_LOGGER_SUPPORT
39 /* #define __USE_POSIX */
41 #include <netinet/in.h>
42 #endif /* SS_LOGGER_SUPPORT */
44 /* TAPA task entry doesn't need anything extra for MTSS */
45 typedef S8 SsdTTskEntry;
48 /* System task entry */
49 typedef struct ssdSTskEntry
56 #ifdef SS_MULTICORE_SUPPORT
58 #endif /* SS_MULTICORE_SUPPORT */
62 #ifdef SS_DRVR_SUPPORT
63 /* Driver task entry */
64 typedef struct ssdDrvrTskEntry
72 /* timer entry--MTSS uses common timers */
73 typedef struct ssdTmrEntry
75 CmTimer timers[TMR_DEF_MAX];
80 /* dynamic pool doesn't need anything extra for MTSS */
81 typedef S8 SsdDPoolEntry;
84 /* static pool -- information for the memory management scheme */
85 typedef S8 SsdSPoolEntry;
88 /* generic pool doesn't need anything extra for MTSS */
89 typedef S8 SsdPoolEntry;
92 /* region doesn't need anything extra for MTSS */
93 typedef S8 SsdRegionEntry;
96 /* system services control point--tick count, timer implementation,
97 * console implementation, IS task implementation
101 unsigned randSeed; /* random number generator seed */
103 Ticks sysTicks; /* elapsed system ticks */
105 pthread_t tmrHdlrTID; /* timer handler thread */
106 CmTqCp tmrTqCp; /* common timer control point */
107 CmTqType tmrTq[SS_MAX_TMRS]; /* common timer queue */
109 sem_t ssStarted; /* posted when SS completes init */
111 FILE *conInFp; /* console input file pointer */
112 FILE *conOutFp; /* console output file pointer */
113 pthread_t conHdlrTID; /* console handler thread ID */
117 FILE *fileOutFp; /* output file pointer */
120 #ifdef SS_DRVR_SUPPORT
121 pthread_t isTskHdlrTID; /* IS task handler thread ID */
122 int isFildes[2]; /* pipe for SSetIntPend to isTskHdlr */
124 Bool sigEvnt; /*mt010.301 Flag to check interupt signal(SIGINT)*/
128 /* mt018.201 - added for memory configuration */
129 typedef struct mtBktCfg
131 Size blkSize; /* bucket quantum size */
132 U32 numBlks; /* the total blocks in the bucket */
135 typedef struct mtRegCfg
140 MtBktCfg bkt[SS_MAX_POOLS_PER_REG];
143 typedef struct mtMemCfg
146 MtRegCfg region[SS_MAX_REGS];
154 typedef struct mtDynBktCfg
156 U16 blkSetRelThreshold; /* threshold value for releasing memory blocks */
157 U16 blkSetAcquireThreshold; /* threshold for requesting additional memory blocks */
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
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 */
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
174 U8 numRegions; /* Number of regions */
175 MtDynRegCfg region[SS_MAX_REGS]; /* Configuration details of each region */
178 /* Global bucket configuration, the number of bucket, block size and the memory
179 * block set size for each bucket */
180 typedef struct mtGlobBktCfg
182 Size blkSize; /* bucket quantum size */
183 U32 numBlks; /* the total blocks in the bucket */
184 U16 bucketSetSize; /* Size of each bucket set */
187 typedef struct mtGlobMemCfg
190 #ifdef XEON_SPECIFIC_CHANGES
193 MtGlobBktCfg bkt[SS_MAX_POOLS_PER_REG];
199 /* mt003.301 Readwrite lock additions */
200 #ifdef SS_LOCK_SUPPORT
201 typedef struct sLockInfo
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 */
213 #endif /* SS_LOCK_SUPPORT */
214 #endif /* __MTSSX__ */
217 /**********************************************************************
219 **********************************************************************/