-
Notifications
You must be signed in to change notification settings - Fork 207
/
cfe_es_verify.h
337 lines (277 loc) · 11.9 KB
/
cfe_es_verify.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/**
* @file
*
* Purpose:
* This header file performs compile time checking for ES configuration
* parameters.
*
* References:
* Flight Software Branch C Coding Standard Version 1.0a
* cFE Flight Software Application Developers Guide
*
* Notes:
* The upper limits are somewhat arbitrary right now.
*
*/
#ifndef CFE_ES_VERIFY_H
#define CFE_ES_VERIFY_H
#include <stdint.h>
#if CFE_PLATFORM_ES_MAX_APPLICATIONS < 6
#error CFE_PLATFORM_ES_MAX_APPLICATIONS cannot be less than 6!
#endif
#if CFE_PLATFORM_ES_MAX_LIBRARIES < 1
#error CFE_PLATFORM_ES_MAX_LIBRARIES cannot be less than 1!
#endif
#if CFE_PLATFORM_ES_ER_LOG_ENTRIES < 1
#error CFE_PLATFORM_ES_ER_LOG_ENTRIES cannot be less than 10!
#endif
#if CFE_PLATFORM_ES_SYSTEM_LOG_SIZE < 512
#error CFE_PLATFORM_ES_SYSTEM_LOG_SIZE cannot be less than 512 Bytes!
#endif
#if CFE_PLATFORM_ES_DEFAULT_STACK_SIZE < 2048
#error CFE_PLATFORM_ES_DEFAULT_STACK_SIZE cannot be less than 2048 Bytes!
#endif
/*
** Number of entries in the ES Object table ( The table that controls core cFE startup )
*/
#if CFE_PLATFORM_ES_OBJECT_TABLE_SIZE < 15
#error CFE_PLATFORM_ES_OBJECT_TABLE_SIZE cannot be less than 15!
#endif
/*
** ES Application Control Scan Rate.
*/
#if CFE_PLATFORM_ES_APP_SCAN_RATE < 100
#error CFE_PLATFORM_ES_APP_SCAN_RATE cannot be less than 100 milliseconds!
#elif CFE_PLATFORM_ES_APP_SCAN_RATE > 20000
#error CFE_PLATFORM_ES_APP_SCAN_RATE cannot be greater than 20 seconds!
#endif
/*
** ES Application Kill Timeout
*/
#if CFE_PLATFORM_ES_APP_KILL_TIMEOUT < 1
#error CFE_PLATFORM_ES_APP_KILL_TIMEOUT cannot be less than 1!
#elif CFE_PLATFORM_ES_APP_KILL_TIMEOUT > 100
#error CFE_PLATFORM_ES_APP_KILL_TIMEOUT cannot be greater than 100!
#endif
/*
** ES / cFE RAM disk parameters
*/
#if CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE < 128
#error CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE cannot be less than 128!
#endif
#if CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS < 128
#error CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS cannot be less than 128!
#endif
#if CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED < 0
#error CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED cannot be less than 0!
#elif CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED > 75
#error CFE_PLATFORM_ES_RAM_DISK_PERCENT_RESERVED cannot be greater than 75!
#endif
/*
** Critical data store size
*/
#if CFE_PLATFORM_ES_CDS_SIZE < (8 * 1024)
#error CFE_PLATFORM_ES_CDS_SIZE cannot be less than 8Kbytes!
#elif CFE_PLATFORM_ES_CDS_SIZE > UINT32_MAX
#error CFE_PLATFORM_ES_CDS_SIZE cannot be greater than UINT32_MAX (4 Gigabytes)!
#endif
/*
** User Reserved Memory Size.
*/
#if CFE_PLATFORM_ES_USER_RESERVED_SIZE < (1 * 1024)
#error CFE_PLATFORM_ES_USER_RESERVED_SIZE cannot be less than 1Kbytes!
#elif CFE_PLATFORM_ES_USER_RESERVED_SIZE > UINT32_MAX
#error CFE_PLATFORM_ES_USER_RESERVED_SIZE cannot be greater than UINT32_MAX (4 Gigabytes)!
#endif
/*
** SysLog mode
*/
#if CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE < 0
#error CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE cannot be less than 0!
#elif CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE > 1
#error CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE cannot be greater than 1!
#endif
/*
** Maximum number of performance IDs
*/
#if CFE_MISSION_ES_PERF_MAX_IDS < 32
#error CFE_MISSION_ES_PERF_MAX_IDS cannot be less than 32!
#endif
/*
** Performance data buffer size
*/
#if CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE < 1025
#error CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE cannot be less than 1025 entries!
#endif
/*
** Maximum number of Registered CDS blocks
*/
#if CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES < 8
#error CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES cannot be less than 8!
#endif
/*
** Maximum number of processor resets before a power-on
*/
#if CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS < 0
#error CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS cannot be less than 0!
#endif
/*
** Alignment of ES memory pool
*/
#if CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN <= 0
#error CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN cannot be 0!
#elif (CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN & (CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN - 1)) != 0
#error CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN must be a power of 2!
#endif
/*
** Intermediate ES Memory Pool Block Sizes
*/
#if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_MISSION_SB_MAX_SB_MSG_SIZE
#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_MISSION_SB_MAX_SB_MSG_SIZE!
#endif
#if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE
#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE!
#endif
#if CFE_PLATFORM_ES_MAX_BLOCK_SIZE < CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE
#error CFE_PLATFORM_ES_MAX_BLOCK_SIZE must be larger than CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE!
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_02 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_03 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_04 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_05 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_06 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_07 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_08 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_09 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_10 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_11 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_12 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_13 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_14 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15 > CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_15 must be less than CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16
#endif
#if CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16 > CFE_PLATFORM_ES_MAX_BLOCK_SIZE
#error CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16 must be less than CFE_PLATFORM_ES_MAX_BLOCK_SIZE
#endif
/*
** Intermediate ES Critical Data Store Memory Pool Block Sizes
*/
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_01 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_02 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_03 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_04 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_05 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_06 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_07 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_08 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_09 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_10 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_11 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_12 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_13 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_14 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15 > CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_15 must be less than CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16
#endif
#if CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16 > CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE
#error CFE_PLATFORM_ES_CDS_MEM_BLOCK_SIZE_16 must be less than CFE_PLATFORM_ES_CDS_MAX_BLOCK_SIZE
#endif
/*
** Validate task stack size...
*/
#if CFE_PLATFORM_ES_START_TASK_STACK_SIZE < 2048
#error CFE_PLATFORM_ES_START_TASK_STACK_SIZE must be greater than or equal to 2048
#endif
#if ((CFE_MISSION_MAX_API_LEN % 4) != 0)
#error CFE_MISSION_MAX_API_LEN must be a multiple of 4
#endif
#if ((CFE_MISSION_MAX_PATH_LEN % 4) != 0)
#error CFE_MISSION_MAX_PATH_LEN must be a multiple of 4
#endif
#if ((CFE_MISSION_MAX_FILE_LEN % 4) != 0)
#error CFE_MISSION_MAX_FILE_LEN must be a multiple of 4
#endif
#if ((CFE_MISSION_ES_CDS_MAX_NAME_LENGTH % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_NAME_LENGTH must be a multiple of 4
#endif
#if ((CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN must be a multiple of 4
#endif
#endif /* CFE_ES_VERIFY_H */