Skip to content

Commit

Permalink
Merge pull request nasa#944 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate 2020-10-13
  • Loading branch information
astrogeco committed Oct 13, 2020
2 parents 7f6fdfb + 2686e50 commit dc3d62b
Show file tree
Hide file tree
Showing 20 changed files with 1,641 additions and 1,504 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: 6.8.0-rc1+dev129

- Rather than having a second pool implementation only for CDS, use the generic pool implementation. This also uses the abstract resource identifiers to identify CDS blocks, rather than a direct reference.
- Add the system-specific module suffix (.o, .so, .obj, etc) and the default CFE core executable name to the configdata structure.
- See <https://github.com/nasa/cFE/pull/944>

### Development Build: 6.8.0-rc1+dev122

- Adds the field `UnregAppID` to track whether an "unregistered" event was generated, un-overloading the EventCount field to serve its primary purpose of counting actual events generated from a valid/registered AppID.
Expand Down
2 changes: 2 additions & 0 deletions cmake/target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ file (REMOVE "${CMAKE_CURRENT_BINARY_DIR}/cfs_static_symbol_list.inc.tmp")
add_executable(core-${TGTNAME} src/target_config.c)

target_compile_definitions(core-${TGTNAME} PRIVATE
CFE_DEFAULT_MODULE_EXTENSION="${CMAKE_SHARED_MODULE_SUFFIX}"
CFE_DEFAULT_CORE_FILENAME="$<TARGET_FILE_NAME:core-${TGTNAME}>"
CFE_CPU_NAME_VALUE="${TGTNAME}"
CFE_SPACECRAFT_ID_VALUE=${SPACECRAFT_ID}
CFE_CPU_ID_VALUE=${${TGTNAME}_PROCESSORID}
Expand Down
3 changes: 3 additions & 0 deletions cmake/target/inc/target_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ typedef const struct
uint16 Default_CpuId; /**< Compile-time value for CPU number */
uint16 Default_SpacecraftId; /**< Compile-time value for Spacecraft ID (mission-wide) */

const char *Default_ModuleExtension; /**< Default system extension for dynamic modules */
const char *Default_CoreFilename; /**< Default file name for CFE core executable/library */

Target_CfeConfigData *CfeConfig; /**< CFE configuration sub-structure */
Target_PspConfigData *PspConfig; /**< PSP configuration sub-structure */
CFE_StaticModuleLoadEntry_t *PspModuleList; /**< List of PSP modules (API structures) statically linked into the core EXE */
Expand Down
9 changes: 9 additions & 0 deletions cmake/target/src/target_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
#define CFE_SPACECRAFT_ID_VALUE 0x42
#endif

#ifndef CFE_DEFAULT_MODULE_EXTENSION
#define CFE_DEFAULT_MODULE_EXTENSION ""
#endif

#ifndef CFE_DEFAULT_CORE_FILENAME
#define CFE_DEFAULT_CORE_FILENAME ""
#endif

Target_CfeConfigData GLOBAL_CFE_CONFIGDATA =
{
Expand Down Expand Up @@ -139,6 +146,8 @@ Target_ConfigData GLOBAL_CONFIGDATA =
.Default_CpuName = CFE_CPU_NAME_VALUE,
.Default_CpuId = CFE_CPU_ID_VALUE,
.Default_SpacecraftId = CFE_SPACECRAFT_ID_VALUE,
.Default_ModuleExtension = CFE_DEFAULT_MODULE_EXTENSION,
.Default_CoreFilename = CFE_DEFAULT_CORE_FILENAME,
.CfeConfig = &GLOBAL_CFE_CONFIGDATA,
.PspConfig = &GLOBAL_PSP_CONFIGDATA,
.PspModuleList = GLOBAL_PSP_MODULELIST,
Expand Down
34 changes: 13 additions & 21 deletions fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ uint32 CFE_ES_CalculateCRC(const void *DataPtr, uint32 DataLength, uint32 InputC
** Purpose: Allocate a data block for a Critical Data Store.
**
*/
int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, int32 BlockSize, const char *Name)
int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t BlockSize, const char *Name)
{
int32 Status;
size_t NameLen = 0;
Expand All @@ -1406,14 +1406,17 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, int32 BlockSize, cons
char AppName[OS_MAX_API_NAME] = {"UNKNOWN"};
char CDSName[CFE_ES_CDS_MAX_FULL_NAME_LEN] = {""};

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

/* Check to make sure calling application is legit */
Status = CFE_ES_GetAppID(&ThisAppId);

if ( Status != CFE_SUCCESS ) /* Application ID was invalid */
{
CFE_ES_WriteToSysLog("CFE_CDS:Register-Bad AppId context\n");
}
else if (CFE_ES_Global.CDSVars.MemPoolSize == 0)
else if (!CFE_ES_Global.CDSIsAvailable)
{
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS not available\n");
Status = CFE_ES_NOT_IMPLEMENTED;
Expand Down Expand Up @@ -1441,16 +1444,13 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, int32 BlockSize, cons
/* of the form "AppName.Name" */
CFE_ES_FormCDSName(CDSName, Name, ThisAppId);

/* Make sure the specified size is acceptable */
if (BlockSize == 0)
{
Status = CFE_ES_CDS_INVALID_SIZE;
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS %s has size of zero\n", Name);
}
else
/* Create CDS and designate it as NOT being a Critical Table */
Status = CFE_ES_RegisterCDSEx(CDSHandlePtr, BlockSize, CDSName, false);

/* If size is unacceptable, log it */
if (Status == CFE_ES_CDS_INVALID_SIZE)
{
/* Create CDS and designate it as NOT being a Critical Table */
Status = CFE_ES_RegisterCDSEx(CDSHandlePtr, BlockSize, CDSName, false);
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS %s has invalid size (%lu)\n", Name, (unsigned long)BlockSize);
}
}
}
Expand Down Expand Up @@ -1479,11 +1479,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, int32 BlockSize, cons
*/
int32 CFE_ES_CopyToCDS(CFE_ES_CDSHandle_t Handle, void *DataToCopy)
{
int32 Status;

Status = CFE_ES_CDSBlockWrite(CFE_ES_Global.CDSVars.Registry[Handle].MemHandle, DataToCopy);

return Status;
return CFE_ES_CDSBlockWrite(Handle, DataToCopy);
} /* End of CFE_ES_CopyToCDS() */

/*
Expand All @@ -1494,11 +1490,7 @@ int32 CFE_ES_CopyToCDS(CFE_ES_CDSHandle_t Handle, void *DataToCopy)
*/
int32 CFE_ES_RestoreFromCDS(void *RestoreToMemory, CFE_ES_CDSHandle_t Handle)
{
int32 Status;

Status = CFE_ES_CDSBlockRead(RestoreToMemory, CFE_ES_Global.CDSVars.Registry[Handle].MemHandle);

return Status;
return CFE_ES_CDSBlockRead(RestoreToMemory, Handle);
} /* End of CFE_ES_RestoreFromCDS() */

/* end of file */
Expand Down
Loading

0 comments on commit dc3d62b

Please sign in to comment.