Skip to content

Commit a85d25b

Browse files
authored
Merge pull request #105 from nasa/v7.0.1-integration
Part cFS/Documents#11, Merge Internal Updates
2 parents 680fe45 + e3e5b85 commit a85d25b

125 files changed

Lines changed: 9605 additions & 8675 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Internal Format Check
2+
3+
# Run on all push and pull requests
4+
on:
5+
push:
6+
branches:
7+
- dev
8+
- main
9+
pull_request:
10+
types:
11+
- opened
12+
- reopened
13+
- synchronize
14+
workflow_dispatch:
15+
16+
jobs:
17+
format-check:
18+
name: Run format check
19+
uses: cFS/workflows/.github/workflows/format-check-reusable-internal.yml@dev

cfecfs/eds2cfetbl/eds2cfetbl.c

Lines changed: 174 additions & 135 deletions
Large diffs are not rendered by default.

cfecfs/eds2cfetbl/scripts/eds_tbltool_filedef.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ EdsDataType_CFE_SB_MsgIdValue_t CFE_SB_CmdTopicIdToMsgId(uint16_t TopicId, uint1
1010
EdsDataType_CFE_SB_MsgIdValue_t CFE_SB_TlmTopicIdToMsgId(uint16_t TopicId, uint16_t InstanceNum);
1111

1212
uint16_t EdsTableTool_GetProcessorId(void);
13-
void EdsTableTool_DoExport(const void *filedefptr, const void *objptr, size_t objsize, const char *typename, size_t typesize);
14-
13+
void EdsTableTool_DoExport(const void *filedefptr,
14+
const void *objptr,
15+
size_t objsize,
16+
const char *typename,
17+
size_t typesize);
1518

1619
static inline EdsDataType_CFE_SB_MsgIdValue_t CFE_SB_GlobalCmdTopicIdToMsgId(uint16_t TopicId)
1720
{
@@ -37,5 +40,4 @@ static inline EdsDataType_CFE_SB_MsgIdValue_t CFE_SB_LocalTlmTopicIdToMsgId(uint
3740
return CFE_SB_TlmTopicIdToMsgId(TopicId, EdsTableTool_GetProcessorId());
3841
}
3942

40-
4143
#endif

cfecfs/edsmsg/eds/cfe_hdr.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
</ConstraintSet>-->
9292
<EntryList>
9393
<Entry name="Sec" type="TlmSecHdr" shortDescription="Telemetry Secondary Header" />
94+
<PaddingEntry sizeInBits="32" shortDescription="Spare bytes for alignment"/>
9495
</EntryList>
9596
</ContainerDataType>
9697

cfecfs/edsmsg/fsw/inc/edsmsg_dispatcher.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
* \param DispatchTable Pointer to the dispatch table
7575
* \returns If successfully dispatched, returns code from handler function, otherwise an error code.
7676
*/
77-
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId, EdsLib_Id_t ComponentId, const CFE_SB_Buffer_t *Buffer,
78-
const void *DispatchTable);
77+
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId,
78+
EdsLib_Id_t ComponentId,
79+
const CFE_SB_Buffer_t *Buffer,
80+
const void *DispatchTable);
7981

8082
#endif /* edsmsg_dispatcher_H */

cfecfs/edsmsg/fsw/inc/edsmsg_hdr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
/**
6666
* \brief Macro to initialize a command header, useful in tables that define commands
6767
*/
68-
#define CFE_MSG_CMD_HDR_INIT(mid, size, fc, cksum) \
69-
{ \
68+
#define CFE_MSG_CMD_HDR_INIT(mid, size, fc, cksum) \
69+
{ \
7070
.CommandHeader = { \
7171
.Message.CCSDS.CommonHdr = \
7272
{ \
@@ -76,7 +76,7 @@
7676
.Length = (size), \
7777
}, \
7878
.Sec = {.FunctionCode = (fc), .Checksum = (cksum)} \
79-
} \
79+
} \
8080
}
8181

8282
/*

cfecfs/edsmsg/fsw/src/edsmsg_dispatcher.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ bool CFE_EDSMSG_Dispatch_CheckComponentMatch(EdsLib_Id_t ComponentId, CFE_Missio
161161
* This just finds the base type using the information in the EDS DB only
162162
*
163163
*-----------------------------------------------------------------*/
164-
CFE_Status_t CFE_EDSMSG_Dispatch_FindArgBaseType(EdsLib_Id_t DeclIntfId, EdsLib_Id_t CompIntfId,
165-
EdsLib_Id_t *ArgTypeBuf)
164+
CFE_Status_t
165+
CFE_EDSMSG_Dispatch_FindArgBaseType(EdsLib_Id_t DeclIntfId, EdsLib_Id_t CompIntfId, EdsLib_Id_t *ArgTypeBuf)
166166
{
167167
const EdsLib_DatabaseObject_t *GD;
168168
EdsLib_Id_t CommandEdsId;
@@ -199,8 +199,9 @@ CFE_Status_t CFE_EDSMSG_Dispatch_FindArgBaseType(EdsLib_Id_t DeclIntfId, EdsLib_
199199
* expected/defined size in EDS
200200
*
201201
*-----------------------------------------------------------------*/
202-
CFE_Status_t CFE_EDSMSG_Dispatch_CheckActualBufferType(const CFE_SB_Buffer_t *Buffer, EdsLib_Id_t *EdsId,
203-
uint32_t *DispatchTblPosition)
202+
CFE_Status_t CFE_EDSMSG_Dispatch_CheckActualBufferType(const CFE_SB_Buffer_t *Buffer,
203+
EdsLib_Id_t *EdsId,
204+
uint32_t *DispatchTblPosition)
204205
{
205206
const EdsLib_DatabaseObject_t *GD;
206207
EdsLib_DataTypeDB_TypeInfo_t TypeInfo;
@@ -254,8 +255,10 @@ CFE_Status_t CFE_EDSMSG_Dispatch_CheckActualBufferType(const CFE_SB_Buffer_t *Bu
254255
* Completely look up the data type from the supplied interface IDs
255256
*
256257
*-----------------------------------------------------------------*/
257-
CFE_Status_t CFE_EDSMSG_Dispatch_FindArgType(EdsLib_Id_t DeclIntfId, EdsLib_Id_t ParentIntfId,
258-
const CFE_SB_Buffer_t *Buffer, uint32_t *DispatchPosition)
258+
CFE_Status_t CFE_EDSMSG_Dispatch_FindArgType(EdsLib_Id_t DeclIntfId,
259+
EdsLib_Id_t ParentIntfId,
260+
const CFE_SB_Buffer_t *Buffer,
261+
uint32_t *DispatchPosition)
259262
{
260263
CFE_Status_t ReturnCode;
261264
EdsLib_Id_t ArgType;
@@ -281,15 +284,15 @@ CFE_Status_t CFE_EDSMSG_Dispatch_FindArgType(EdsLib_Id_t DeclIntfId, EdsLib_Id_t
281284
* Finds the matching handler function from the dispatch table
282285
*
283286
*-----------------------------------------------------------------*/
284-
CFE_EDSMSG_DispatchFunc_t CFE_EDSMSG_Dispatch_LookupHandler(const void *DispatchTable, size_t DispatchStartOffset,
285-
uint32_t DispatchPosition)
287+
CFE_EDSMSG_DispatchFunc_t
288+
CFE_EDSMSG_Dispatch_LookupHandler(const void *DispatchTable, size_t DispatchStartOffset, uint32_t DispatchPosition)
286289
{
287290
const uint8 *MemAddr;
288291
const CFE_EDSMSG_DispatchFunc_t *DispatchTbl;
289292

290293
/* calculate the address of the first handler routine for this intf
291294
* Note the START offsets are in bytes, so this must be done in uint8* logic */
292-
MemAddr = (const uint8 *)DispatchTable;
295+
MemAddr = (const uint8 *)DispatchTable;
293296
MemAddr += DispatchStartOffset;
294297

295298
/* now shift to the correct type (function pointer) and apply the position offset */
@@ -304,8 +307,10 @@ CFE_EDSMSG_DispatchFunc_t CFE_EDSMSG_Dispatch_LookupHandler(const void *Dispatch
304307
* Dispatch the message based on the IDs and dispatch table
305308
*
306309
*-----------------------------------------------------------------*/
307-
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId, EdsLib_Id_t ComponentId, const CFE_SB_Buffer_t *Buffer,
308-
const void *DispatchTable)
310+
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId,
311+
EdsLib_Id_t ComponentId,
312+
const CFE_SB_Buffer_t *Buffer,
313+
const void *DispatchTable)
309314
{
310315
CFE_Status_t ReturnCode;
311316
CFE_MissionLib_TopicInfo_t TopicInfo;

cfecfs/edsmsg/fsw/ut-stubs/edsmsg_dispatcher_stubs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
* Generated stub function for CFE_EDSMSG_Dispatch()
3333
* ----------------------------------------------------
3434
*/
35-
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId, EdsLib_Id_t ComponentId, const CFE_SB_Buffer_t *Buffer,
36-
const void *DispatchTable)
35+
CFE_Status_t CFE_EDSMSG_Dispatch(EdsLib_Id_t DeclIntfId,
36+
EdsLib_Id_t ComponentId,
37+
const CFE_SB_Buffer_t *Buffer,
38+
const void *DispatchTable)
3739
{
3840
UT_GenStub_SetupReturnBuffer(CFE_EDSMSG_Dispatch, CFE_Status_t);
3941

cfecfs/missionlib/cmake/dbobj_patternrules.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ include $(EDS_REPO_SOURCE_DIR)/edslib/cmake/base_patternrules.mk
2121
# linker logic that CMake uses, this just assumes a GNU-style LD, and that the file extension
2222
# (.so or .obj) indicates the style of loadable object being used.
2323

24+
$(O)/$(EDS_FILE_PREFIX)_sb_dispatchdb.so: EXTRA_LINK_LIBS=-l:$(EDS_FILE_PREFIX)_db.so
25+
2426
$(O)/%.so:
2527
@echo EDS: Linking shared object $(@) for $(EDSTOOL_ARCH)
26-
$(LD) $(SHARED_LDFLAGS) -shared -o $@ $^ -L$(O) -l:$(EDS_FILE_PREFIX)_db.so
28+
$(LD) $(SHARED_LDFLAGS) -shared -o $@ $^ -L$(O) $(EXTRA_LINK_LIBS)
2729

2830
$(O)/%.obj:
2931
@echo EDS: Linking relocatable object $(@) for $(EDSTOOL_ARCH)

cfecfs/missionlib/eds/91-write_cosmos_txt.lua

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ write_cosmos_lineitem = function(output,line_writer,entry,qual_prefix,descr)
150150
bits_remainder = bits_remainder - attribs.bitsize
151151
end
152152
attribs.bitsize = bits_remainder
153-
elseif (entry.entity_type == "STRING_DATATYPE" or entry.entity_type == "BINARY_DATATYPE") then
153+
elseif (entry.entity_type == "STRING_DATATYPE") then
154154
attribs.ctype = "STRING"
155-
elseif (SEDS.index_datatype_filter(entry)) then
155+
elseif (entry.entity_type == "BINARY_DATATYPE") then
156+
attribs.ctype = "BLOCK"
157+
elseif (entry.entity_type == "FLOAT_DATATYPE") then
158+
attribs.ctype = "FLOAT"
159+
elseif (entry.entity_type == "BOOLEAN_DATATYPE" or SEDS.index_datatype_filter(entry)) then
156160
attribs.ctype = (entry.is_signed and "INT") or "UINT"
157161

158162
-- This only handles integers
@@ -193,38 +197,68 @@ write_cosmos_block = function(output,line_writer,entry,qual_prefix,descr)
193197

194198
end
195199

196-
197200
-- -------------------------------------------------------------------------
198201
-- Helper function: write a flattened array, adding a digit to the name prefix
199202
-- -------------------------------------------------------------------------
200203
write_cosmos_array_members = function(output,line_writer,arr,qual_prefix)
201204

202-
local min, max
203-
204205
-- Arrays can be dimensioned by an index type, and that type may have a better string representation
205206
-- This also means that the range could be something other than the typical limits
207+
local min, max
208+
local minv, maxv
206209
local dimension_typename
210+
local writer
211+
local datatyperef
212+
local dimension_obj
213+
214+
-- This wrapper handles the case where the array elements are not at byte boundaries
215+
-- The output is expressed as a series of 8 bit values (packed)
216+
local_packedarray_writer = function(idx, element_qual_prefix)
217+
local attribs = {
218+
name = SEDS.to_macro_name(element_qual_prefix),
219+
ctype = "UINT",
220+
bitsize = 8,
221+
descr = string.format("%s packed byte %d", qual_prefix or "array", idx)
222+
}
223+
line_writer(output, attribs)
224+
end
207225

208-
for dimension in arr:iterate_subtree("DIMENSION") do
209-
if (dimension.indextyperef) then
210-
dimension_typename = dimension.indextyperef:get_qualified_name()
211-
min = dimension.indextyperef.resolved_range.min
212-
max = dimension.indextyperef.resolved_range.max
226+
-- This wrapper handles the normal case where the array elements are a
227+
-- whole number of bytes, and thus spelled out normally in the definition
228+
local_array_writer = function(idx, element_qual_prefix)
229+
write_cosmos_block(output,line_writer,datatyperef,element_qual_prefix)
230+
end
231+
232+
datatyperef = arr.datatyperef
233+
234+
-- Check if this needs to be output as a bitmap
235+
if ((datatyperef.resolved_size.bits % 8) ~= 0) then
236+
-- Packing: The dimension is the size of the whole array
237+
min = { value = 0, inclusive = true }
238+
max = { value = arr.resolved_size.bits / 8, inclusive = false }
239+
writer = local_packedarray_writer
240+
else
241+
-- Normal: The actual dimension will be used
242+
for dimension in arr:iterate_subtree("DIMENSION") do
243+
if (dimension.indextyperef) then
244+
dimension_typename = dimension.indextyperef:get_qualified_name()
245+
min = dimension.indextyperef.resolved_range.min
246+
max = dimension.indextyperef.resolved_range.max
247+
end
213248
end
249+
writer = local_array_writer
214250
end
215251

216252
-- As a fallback use a generic 32-bit integer as the index type
217-
local dimension_obj = SEDS.edslib.NewObject(dimension_typename or "BASE_TYPES/int32")
253+
dimension_obj = SEDS.edslib.NewObject(dimension_typename or "BASE_TYPES/int32")
218254

219255
-- Determine the usable min/max -- this means adjusting for inclusiveness of the limits
220-
local minv
221256
if (min) then
222257
minv = min.value + (min.inclusive and 0 or 1)
223258
else
224259
minv = 0
225260
end
226261

227-
local maxv
228262
if (max) then
229263
maxv = max.value - (max.inclusive and 0 or 1)
230264
else
@@ -234,7 +268,7 @@ write_cosmos_array_members = function(output,line_writer,arr,qual_prefix)
234268
for i=minv,maxv do
235269

236270
dimension_obj(i)
237-
write_cosmos_block(output,line_writer,arr.datatyperef,append_qual_prefix(qual_prefix, dimension_obj))
271+
writer(i, append_qual_prefix(qual_prefix, dimension_obj))
238272

239273
end
240274

@@ -355,7 +389,7 @@ for _,instance in ipairs(SEDS.highlevel_interfaces) do
355389
-- The various interfaces should be attached under required_links
356390
for _,binding in ipairs(instance.required_links) do
357391
local reqintf = binding.reqintf
358-
local intf_type_str = reqintf.type:get_qualified_name()
392+
local intf_type_str = reqintf.type:get_qualified_name()
359393
if (intf_type_str == "CFE_SB/Telemetry" or intf_type_str == "CFE_SB/Telecommand") then
360394
local cmd = reqintf.intf_commands and reqintf.intf_commands[1]
361395

@@ -391,4 +425,3 @@ for _,instance in ipairs(SEDS.highlevel_interfaces) do
391425
end
392426
end
393427
end
394-

0 commit comments

Comments
 (0)