Skip to content

Commit 9804b59

Browse files
authored
Merge pull request #991 from nasa/integration-candidate
Integration Candidate: 2020-11-03
2 parents e0d1ce8 + 0ba6091 commit 9804b59

File tree

19 files changed

+353
-253
lines changed

19 files changed

+353
-253
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob
1010

1111
## Version History
1212

13+
### Development Build: 6.8.0-rc1+dev164
14+
15+
- Keeps task names under 16 chars to make more debugger friendly, regardless
16+
of the OSAL limit. Task name shows up as `ES_BG_TASK`
17+
- Move ES typedefs shared across API and telemetry messages into the `cfe_es_extern_typedefs.h`.
18+
- Move all ES typedefs that define the telemetry interface and structures that define the output of commands that write data files into this group (query all apps, query all tasks, query all CDS).
19+
- Remove some localized definitions and replace with MISSION scope definitions where appropriate/necessary.
20+
- Adjust `strncpy()` call to avoid compiler warning
21+
- Cast fixed width types to the type used in the `printf` call. Removes `printf` type warnings on the 32-bit RTEMS build.
22+
- See <https://github.com/nasa/cFE/pull/991>
23+
1324
### Development Build: 6.8.0-rc1+dev150
1425

1526
- Provide new Library API similar to App API

cmake/sample_defs/cpu1_cfe_es_startup.scr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CFE_LIB, /cf/sample_lib.so, SAMPLE_LibInit, SAMPLE_LIB, 0, 0, 0x0, 0;
2-
CFE_APP, /cf/sample_app.so, SAMPLE_AppMain, SAMPLE_APP, 50, 16384, 0x0, 0;
1+
CFE_LIB, /cf/sample_lib.so, SAMPLE_LIB_Init, SAMPLE_LIB, 0, 0, 0x0, 0;
2+
CFE_APP, /cf/sample_app.so, SAMPLE_APP_Main, SAMPLE_APP, 50, 16384, 0x0, 0;
33
CFE_APP, /cf/ci_lab.so, CI_Lab_AppMain, CI_LAB_APP, 60, 16384, 0x0, 0;
44
CFE_APP, /cf/to_lab.so, TO_Lab_AppMain, TO_LAB_APP, 70, 16384, 0x0, 0;
55
CFE_APP, /cf/sch_lab.so, SCH_Lab_AppMain, SCH_LAB_APP, 80, 16384, 0x0, 0;

cmake/sample_defs/sample_mission_cfg.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,27 @@
459459
*/
460460
#define CFE_MISSION_ES_PERF_MAX_IDS 128
461461

462+
/** \cfeescfg Maximum number of block sizes in pool structures
463+
**
464+
** \par Description:
465+
** The upper limit for the number of block sizes supported in the generic
466+
** pool implementation, which in turn implements the memory pools and CDS.
467+
** This definition is used as the array size with the pool stats structure,
468+
** and therefore should be consistent across all CPUs in a mission, as well
469+
** as with the ground station.
470+
**
471+
** There is also a platform-specific limit which may be fewer than this
472+
** value.
473+
**
474+
** \par Limits:
475+
** Must be at least one. No specific upper limit, but the number is
476+
** anticipated to be reasonably small (i.e. tens, not hundreds). Large
477+
** values have not been tested.
478+
**
479+
**
480+
*/
481+
#define CFE_MISSION_ES_POOL_MAX_BUCKETS 17
482+
462483
/**
463484
** \cfetblcfg Maximum Length of Full Table Name in messages
464485
**
@@ -589,7 +610,7 @@
589610
** This value should be kept as a multiple of 4, to maintain alignment of
590611
** any possible neighboring fields without implicit padding.
591612
*/
592-
#define CFE_MISSION_ES_CDS_MAX_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)
613+
#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)
593614

594615

595616

docs/src/cfe_es.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@
760760
<LI> <B>Number of Free Bytes</B> - The total number of bytes in the Memory Pool that have never
761761
been allocated to a Memory Block<BR>
762762
<LI> <B>Block Statistics</B> - For each specified size of memory block (of which there are
763-
#CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES), the following statistics are kept<BR>
763+
#CFE_MISSION_ES_POOL_MAX_BUCKETS), the following statistics are kept<BR>
764764
<UL>
765765
<LI> <B>Block Size</B> - The size, in bytes, of all blocks of this type<BR>
766766
<LI> <B>Number of Blocks Allocated</B> - The number of this sized block which are currently

fsw/cfe-core/src/es/cfe_es_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ int32 CFE_ES_ReloadApp(CFE_ES_ResourceID_t AppID, const char *AppFileName)
256256
{
257257
CFE_ES_SysLogWrite_Unsync("CFE_ES_ReloadApp: Reload Application %s Initiated. New filename = %s\n",
258258
CFE_ES_AppRecordGetName(AppRecPtr), AppFileName);
259-
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName, OS_MAX_PATH_LEN);
259+
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName,
260+
sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1);
261+
AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = 0;
260262
AppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD;
261263
}
262264
else
@@ -1706,7 +1708,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t B
17061708
CFE_ES_ResourceID_t ThisAppId;
17071709

17081710
char AppName[OS_MAX_API_NAME] = {"UNKNOWN"};
1709-
char CDSName[CFE_ES_CDS_MAX_FULL_NAME_LEN] = {""};
1711+
char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""};
17101712

17111713
/* Initialize output to safe value, in case this fails */
17121714
*CDSHandlePtr = CFE_ES_RESOURCEID_UNDEFINED;

fsw/cfe-core/src/es/cfe_es_backgroundtask.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#include "cfe_es_global.h"
4242
#include "cfe_es_task.h"
4343

44-
#define CFE_ES_BACKGROUND_SEM_NAME "ES_BackgroundSem"
45-
#define CFE_ES_BACKGROUND_CHILD_NAME "ES_BackgroundTask"
44+
#define CFE_ES_BACKGROUND_SEM_NAME "ES_BG_SEM"
45+
#define CFE_ES_BACKGROUND_CHILD_NAME "ES_BG_TASK"
4646
#define CFE_ES_BACKGROUND_CHILD_STACK_PTR NULL
4747
#define CFE_ES_BACKGROUND_CHILD_STACK_SIZE CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE
4848
#define CFE_ES_BACKGROUND_CHILD_PRIORITY CFE_PLATFORM_ES_PERF_CHILD_PRIORITY

fsw/cfe-core/src/es/cfe_es_cds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ typedef struct
115115
CFE_ES_ResourceID_t BlockID; /**< Abstract ID associated with this CDS block */
116116
CFE_ES_CDS_Offset_t BlockOffset; /**< Start offset of the block in CDS memory */
117117
CFE_ES_CDS_Offset_t BlockSize; /**< Size, in bytes, of the CDS memory block */
118-
char Name[CFE_ES_CDS_MAX_FULL_NAME_LEN];
118+
char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];
119119
bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */
120120
} CFE_ES_CDS_RegRec_t;
121121

fsw/cfe-core/src/es/cfe_es_mempool.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
** Type Definitions
6262
*/
6363

64-
const CFE_ES_MemOffset_t CFE_ES_MemPoolDefSize[CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES] =
64+
const CFE_ES_MemOffset_t CFE_ES_MemPoolDefSize[CFE_PLATFORM_ES_POOL_MAX_BUCKETS] =
6565
{
6666
CFE_PLATFORM_ES_MAX_BLOCK_SIZE,
6767
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16,
@@ -138,7 +138,7 @@ int32 CFE_ES_PoolCreateNoSem(CFE_ES_MemHandle_t *PoolID,
138138
uint8 *MemPtr,
139139
CFE_ES_MemOffset_t Size )
140140
{
141-
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES,
141+
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS,
142142
&CFE_ES_MemPoolDefSize[0],CFE_ES_NO_MUTEX);
143143
}
144144

@@ -149,7 +149,7 @@ int32 CFE_ES_PoolCreate(CFE_ES_MemHandle_t *PoolID,
149149
uint8 *MemPtr,
150150
CFE_ES_MemOffset_t Size )
151151
{
152-
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES,
152+
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS,
153153
&CFE_ES_MemPoolDefSize[0],CFE_ES_USE_MUTEX);
154154
}
155155

@@ -195,9 +195,9 @@ int32 CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID,
195195
if (BlockSizes == NULL)
196196
{
197197
BlockSizes = CFE_ES_MemPoolDefSize;
198-
if (NumBlockSizes == 0 || NumBlockSizes > CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES)
198+
if (NumBlockSizes == 0 || NumBlockSizes > CFE_PLATFORM_ES_POOL_MAX_BUCKETS)
199199
{
200-
NumBlockSizes = CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES;
200+
NumBlockSizes = CFE_PLATFORM_ES_POOL_MAX_BUCKETS;
201201
}
202202
}
203203

@@ -636,7 +636,7 @@ int32 CFE_ES_GetMemPoolStats(CFE_ES_MemPoolStats_t *BufPtr,
636636
&BufPtr->NumBlocksRequested,
637637
&BufPtr->CheckErrCtr);
638638

639-
for (Idx = 0; Idx < CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES; ++Idx)
639+
for (Idx = 0; Idx < CFE_MISSION_ES_POOL_MAX_BUCKETS; ++Idx)
640640
{
641641
CFE_ES_GenPoolGetBucketUsage(&PoolRecPtr->Pool, NumBuckets,
642642
&BufPtr->BlockStats[Idx]);

fsw/cfe-core/src/es/cfe_es_task.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,10 +1727,10 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data)
17271727
{
17281728
int32 Status;
17291729
const CFE_ES_DeleteCDSCmd_Payload_t *cmd = &data->Payload;
1730-
char LocalCdsName[CFE_ES_CDS_MAX_FULL_NAME_LEN];
1730+
char LocalCdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];
17311731

17321732
CFE_SB_MessageStringGet(LocalCdsName, (char *)cmd->CdsName, NULL,
1733-
CFE_ES_CDS_MAX_FULL_NAME_LEN, sizeof(cmd->CdsName));
1733+
CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, sizeof(cmd->CdsName));
17341734

17351735
Status = CFE_ES_DeleteCDS(LocalCdsName, false);
17361736

@@ -1874,14 +1874,11 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data)
18741874
if ( CFE_ES_CDSBlockRecordIsUsed(RegRecPtr) )
18751875
{
18761876
/* Fill CDS Registry Dump Record with relevant information */
1877+
memset(&DumpRecord, 0, sizeof(DumpRecord));
18771878
DumpRecord.Size = CFE_ES_CDSBlockRecordGetUserSize(RegRecPtr);
18781879
DumpRecord.Handle = CFE_ES_CDSBlockRecordGetID(RegRecPtr);
18791880
DumpRecord.Table = RegRecPtr->Table;
1880-
DumpRecord.ByteAlignSpare1 = 0;
1881-
1882-
/* strncpy will zero out any unused buffer - memset not necessary */
18831881
strncpy(DumpRecord.Name, RegRecPtr->Name, sizeof(DumpRecord.Name)-1);
1884-
DumpRecord.Name[sizeof(DumpRecord.Name)-1] = 0;
18851882

18861883
/* Output Registry Dump Record to Registry Dump File */
18871884
Status = OS_write(FileDescriptor,

fsw/cfe-core/src/es/cfe_es_verify.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@
362362
#if ((CFE_MISSION_ES_CDS_MAX_NAME_LENGTH % 4) != 0)
363363
#error CFE_MISSION_ES_CDS_MAX_NAME_LENGTH must be a multiple of 4
364364
#endif
365-
#if ((CFE_MISSION_ES_CDS_MAX_NAME_LEN % 4) != 0)
366-
#error CFE_MISSION_ES_CDS_MAX_NAME_LEN must be a multiple of 4
365+
#if ((CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN % 4) != 0)
366+
#error CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN must be a multiple of 4
367367
#endif
368368

369369

0 commit comments

Comments
 (0)