Skip to content

Commit

Permalink
Fix nasa#940, Add module suffix and core name to configdata
Browse files Browse the repository at this point in the history
Add the system-specific module suffix (.o, .so, .obj, etc) and the
default CFE core executable name to the configdata structure.

This information has several useful purposes.
  • Loading branch information
jphickey committed Oct 7, 2020
1 parent 7f6fdfb commit 043b608
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions cmake/target/src/target_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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

0 comments on commit 043b608

Please sign in to comment.