Skip to content

Commit

Permalink
Merge pull request nasa#991 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate: 2020-11-03
  • Loading branch information
astrogeco authored Nov 4, 2020
2 parents e0d1ce8 + 0ba6091 commit 9804b59
Show file tree
Hide file tree
Showing 19 changed files with 353 additions and 253 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: 6.8.0-rc1+dev164

- Keeps task names under 16 chars to make more debugger friendly, regardless
of the OSAL limit. Task name shows up as `ES_BG_TASK`
- Move ES typedefs shared across API and telemetry messages into the `cfe_es_extern_typedefs.h`.
- 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).
- Remove some localized definitions and replace with MISSION scope definitions where appropriate/necessary.
- Adjust `strncpy()` call to avoid compiler warning
- Cast fixed width types to the type used in the `printf` call. Removes `printf` type warnings on the 32-bit RTEMS build.
- See <https://github.com/nasa/cFE/pull/991>

### Development Build: 6.8.0-rc1+dev150

- Provide new Library API similar to App API
Expand Down
4 changes: 2 additions & 2 deletions cmake/sample_defs/cpu1_cfe_es_startup.scr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CFE_LIB, /cf/sample_lib.so, SAMPLE_LibInit, SAMPLE_LIB, 0, 0, 0x0, 0;
CFE_APP, /cf/sample_app.so, SAMPLE_AppMain, SAMPLE_APP, 50, 16384, 0x0, 0;
CFE_LIB, /cf/sample_lib.so, SAMPLE_LIB_Init, SAMPLE_LIB, 0, 0, 0x0, 0;
CFE_APP, /cf/sample_app.so, SAMPLE_APP_Main, SAMPLE_APP, 50, 16384, 0x0, 0;
CFE_APP, /cf/ci_lab.so, CI_Lab_AppMain, CI_LAB_APP, 60, 16384, 0x0, 0;
CFE_APP, /cf/to_lab.so, TO_Lab_AppMain, TO_LAB_APP, 70, 16384, 0x0, 0;
CFE_APP, /cf/sch_lab.so, SCH_Lab_AppMain, SCH_LAB_APP, 80, 16384, 0x0, 0;
Expand Down
23 changes: 22 additions & 1 deletion cmake/sample_defs/sample_mission_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,27 @@
*/
#define CFE_MISSION_ES_PERF_MAX_IDS 128

/** \cfeescfg Maximum number of block sizes in pool structures
**
** \par Description:
** The upper limit for the number of block sizes supported in the generic
** pool implementation, which in turn implements the memory pools and CDS.
** This definition is used as the array size with the pool stats structure,
** and therefore should be consistent across all CPUs in a mission, as well
** as with the ground station.
**
** There is also a platform-specific limit which may be fewer than this
** value.
**
** \par Limits:
** Must be at least one. No specific upper limit, but the number is
** anticipated to be reasonably small (i.e. tens, not hundreds). Large
** values have not been tested.
**
**
*/
#define CFE_MISSION_ES_POOL_MAX_BUCKETS 17

/**
** \cfetblcfg Maximum Length of Full Table Name in messages
**
Expand Down Expand Up @@ -589,7 +610,7 @@
** This value should be kept as a multiple of 4, to maintain alignment of
** any possible neighboring fields without implicit padding.
*/
#define CFE_MISSION_ES_CDS_MAX_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)
#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4)



Expand Down
2 changes: 1 addition & 1 deletion docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
<LI> <B>Number of Free Bytes</B> - The total number of bytes in the Memory Pool that have never
been allocated to a Memory Block<BR>
<LI> <B>Block Statistics</B> - For each specified size of memory block (of which there are
#CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES), the following statistics are kept<BR>
#CFE_MISSION_ES_POOL_MAX_BUCKETS), the following statistics are kept<BR>
<UL>
<LI> <B>Block Size</B> - The size, in bytes, of all blocks of this type<BR>
<LI> <B>Number of Blocks Allocated</B> - The number of this sized block which are currently
Expand Down
6 changes: 4 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ int32 CFE_ES_ReloadApp(CFE_ES_ResourceID_t AppID, const char *AppFileName)
{
CFE_ES_SysLogWrite_Unsync("CFE_ES_ReloadApp: Reload Application %s Initiated. New filename = %s\n",
CFE_ES_AppRecordGetName(AppRecPtr), AppFileName);
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName, OS_MAX_PATH_LEN);
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName,
sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1);
AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = 0;
AppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD;
}
else
Expand Down Expand Up @@ -1706,7 +1708,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t B
CFE_ES_ResourceID_t ThisAppId;

char AppName[OS_MAX_API_NAME] = {"UNKNOWN"};
char CDSName[CFE_ES_CDS_MAX_FULL_NAME_LEN] = {""};
char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""};

/* Initialize output to safe value, in case this fails */
*CDSHandlePtr = CFE_ES_RESOURCEID_UNDEFINED;
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_backgroundtask.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
#include "cfe_es_global.h"
#include "cfe_es_task.h"

#define CFE_ES_BACKGROUND_SEM_NAME "ES_BackgroundSem"
#define CFE_ES_BACKGROUND_CHILD_NAME "ES_BackgroundTask"
#define CFE_ES_BACKGROUND_SEM_NAME "ES_BG_SEM"
#define CFE_ES_BACKGROUND_CHILD_NAME "ES_BG_TASK"
#define CFE_ES_BACKGROUND_CHILD_STACK_PTR NULL
#define CFE_ES_BACKGROUND_CHILD_STACK_SIZE CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE
#define CFE_ES_BACKGROUND_CHILD_PRIORITY CFE_PLATFORM_ES_PERF_CHILD_PRIORITY
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_cds.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ typedef struct
CFE_ES_ResourceID_t BlockID; /**< Abstract ID associated with this CDS block */
CFE_ES_CDS_Offset_t BlockOffset; /**< Start offset of the block in CDS memory */
CFE_ES_CDS_Offset_t BlockSize; /**< Size, in bytes, of the CDS memory block */
char Name[CFE_ES_CDS_MAX_FULL_NAME_LEN];
char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];
bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */
} CFE_ES_CDS_RegRec_t;

Expand Down
12 changes: 6 additions & 6 deletions fsw/cfe-core/src/es/cfe_es_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
** Type Definitions
*/

const CFE_ES_MemOffset_t CFE_ES_MemPoolDefSize[CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES] =
const CFE_ES_MemOffset_t CFE_ES_MemPoolDefSize[CFE_PLATFORM_ES_POOL_MAX_BUCKETS] =
{
CFE_PLATFORM_ES_MAX_BLOCK_SIZE,
CFE_PLATFORM_ES_MEM_BLOCK_SIZE_16,
Expand Down Expand Up @@ -138,7 +138,7 @@ int32 CFE_ES_PoolCreateNoSem(CFE_ES_MemHandle_t *PoolID,
uint8 *MemPtr,
CFE_ES_MemOffset_t Size )
{
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES,
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS,
&CFE_ES_MemPoolDefSize[0],CFE_ES_NO_MUTEX);
}

Expand All @@ -149,7 +149,7 @@ int32 CFE_ES_PoolCreate(CFE_ES_MemHandle_t *PoolID,
uint8 *MemPtr,
CFE_ES_MemOffset_t Size )
{
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES,
return CFE_ES_PoolCreateEx(PoolID, MemPtr, Size, CFE_PLATFORM_ES_POOL_MAX_BUCKETS,
&CFE_ES_MemPoolDefSize[0],CFE_ES_USE_MUTEX);
}

Expand Down Expand Up @@ -195,9 +195,9 @@ int32 CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID,
if (BlockSizes == NULL)
{
BlockSizes = CFE_ES_MemPoolDefSize;
if (NumBlockSizes == 0 || NumBlockSizes > CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES)
if (NumBlockSizes == 0 || NumBlockSizes > CFE_PLATFORM_ES_POOL_MAX_BUCKETS)
{
NumBlockSizes = CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES;
NumBlockSizes = CFE_PLATFORM_ES_POOL_MAX_BUCKETS;
}
}

Expand Down Expand Up @@ -636,7 +636,7 @@ int32 CFE_ES_GetMemPoolStats(CFE_ES_MemPoolStats_t *BufPtr,
&BufPtr->NumBlocksRequested,
&BufPtr->CheckErrCtr);

for (Idx = 0; Idx < CFE_ES_DEFAULT_MEMPOOL_BLOCK_SIZES; ++Idx)
for (Idx = 0; Idx < CFE_MISSION_ES_POOL_MAX_BUCKETS; ++Idx)
{
CFE_ES_GenPoolGetBucketUsage(&PoolRecPtr->Pool, NumBuckets,
&BufPtr->BlockStats[Idx]);
Expand Down
9 changes: 3 additions & 6 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1727,10 +1727,10 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data)
{
int32 Status;
const CFE_ES_DeleteCDSCmd_Payload_t *cmd = &data->Payload;
char LocalCdsName[CFE_ES_CDS_MAX_FULL_NAME_LEN];
char LocalCdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN];

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

Status = CFE_ES_DeleteCDS(LocalCdsName, false);

Expand Down Expand Up @@ -1874,14 +1874,11 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data)
if ( CFE_ES_CDSBlockRecordIsUsed(RegRecPtr) )
{
/* Fill CDS Registry Dump Record with relevant information */
memset(&DumpRecord, 0, sizeof(DumpRecord));
DumpRecord.Size = CFE_ES_CDSBlockRecordGetUserSize(RegRecPtr);
DumpRecord.Handle = CFE_ES_CDSBlockRecordGetID(RegRecPtr);
DumpRecord.Table = RegRecPtr->Table;
DumpRecord.ByteAlignSpare1 = 0;

/* strncpy will zero out any unused buffer - memset not necessary */
strncpy(DumpRecord.Name, RegRecPtr->Name, sizeof(DumpRecord.Name)-1);
DumpRecord.Name[sizeof(DumpRecord.Name)-1] = 0;

/* Output Registry Dump Record to Registry Dump File */
Status = OS_write(FileDescriptor,
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_verify.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@
#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_NAME_LEN % 4) != 0)
#error CFE_MISSION_ES_CDS_MAX_NAME_LEN must be a multiple of 4
#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


Expand Down
Loading

0 comments on commit 9804b59

Please sign in to comment.