-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #2564, add config tool for platform-specific settings
Improve the config module to handle platform-specific definitions from the "cfe_platform_cfg.h" file. Specifically this can generate static tables/lists for items that cannot be simply handled via the C preprocessor. Notable examples are the mem pool size lists and the allowable processor/spacecraft IDs in table services.
- Loading branch information
Showing
35 changed files
with
1,245 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* This file is auto-generated from CMake build system. Do not manually edit! */ | ||
#include "cfe_configid_offset.h" | ||
#include "cfe_config_nametable.h" | ||
|
||
#define CFE_CONFIGID_DEFINE(x) [CFE_CONFIGID_OFFSETNAME(x)] = { #x }, | ||
|
||
/* Map of configuration key IDs to printable names */ | ||
const CFE_Config_IdNameEntry_t CFE_CONFIGID_NAMETABLE[CFE_ConfigIdOffset_MAX] = | ||
{ | ||
@GENERATED_ID_MACRO_LIST@ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* This file is auto-generated from CMake build system. Do not manually edit! */ | ||
#ifndef CFE_CONFIGID_OFFSET_H | ||
#define CFE_CONFIGID_OFFSET_H | ||
|
||
#define CFE_CONFIGID_OFFSETNAME(x) CFE_ConfigIdOffset_ ## x | ||
|
||
#undef CFE_CONFIGID_DEFINE | ||
#define CFE_CONFIGID_DEFINE(x) CFE_CONFIGID_OFFSETNAME(x), | ||
|
||
/* Value offsets from base (needed for macros; do not use directly) */ | ||
typedef enum CFE_ConfigIdOffset_Enum | ||
{ | ||
@GENERATED_ID_MACRO_LIST@ | ||
CFE_ConfigIdOffset_MAX | ||
} CFE_ConfigIdOffset_Enum_t; | ||
|
||
#undef CFE_CONFIGID_DEFINE | ||
|
||
#endif /* CFE_CONFIGID_OFFSET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <common_types.h> | ||
#include <cfe_platform_cfg.h> | ||
|
||
#include "cfe_config_core_internal.h" | ||
#include "cfe_config_ids.h" | ||
#include "cfe_config_set.h" | ||
|
||
#define ARRAY_NAME(a) CFE_CONFIG_ ## a ## _CONTENT | ||
#define ARRAY_LEN(a) (sizeof(ARRAY_NAME(a)) / sizeof(ARRAY_NAME(a)[0])) | ||
|
||
#define CFE_PLATFORMCFG_ENTRY(x) {\ | ||
static const CFE_Config_ArrayValue_t ARR_ ## x = { ARRAY_LEN(x), ARRAY_NAME(x) };\ | ||
CFE_Config_SetArrayValue(CFE_CONFIGID_FROM_OFFSET(x), &ARR_ ## x);\ | ||
} | ||
|
||
@PLATCFG_CONTENT@ | ||
|
||
void CFE_Config_SetupPlatformConfigInfo(void) | ||
{ | ||
@PLATCFG_LIST@ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
file(READ ${LIST_FILE} PLATCFG_LIST) | ||
file(READ ${CONTENT_FILE} PLATCFG_CONTENT) | ||
|
||
configure_file(cfe_platform_cfg.c.in ${OUTPUT_FILE} @ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
########################################################## | ||
# | ||
# CFE Configuration key names - base set | ||
# | ||
# These configuration keys are set via the FSW code | ||
# as part of the basic init routine. They will be set | ||
# to the same values on all CPUs. | ||
# | ||
########################################################## | ||
|
||
# Append the set of version description config keys | ||
list(APPEND CFE_CONFIG_IDS | ||
MISSION_NAME | ||
MISSION_SRCVER | ||
MISSION_EDS_DB | ||
MISSION_SBINTF_DB | ||
|
||
CORE_VERSION_MAJOR | ||
CORE_VERSION_MINOR | ||
CORE_VERSION_REVISION | ||
CORE_VERSION_MISSION_REV | ||
CORE_VERSION_BUILDNUM | ||
CORE_VERSION_BASELINE | ||
CORE_VERSION_DESCRIPTION | ||
|
||
CORE_BUILDINFO_DATE | ||
CORE_BUILDINFO_USER | ||
CORE_BUILDINFO_HOST | ||
) | ||
|
||
# Generate config ID for source version of modules that are included in the build | ||
# NOTE: the presence in this list does not necesarily mean it will have a value at runtime, | ||
# which may be the case for dynamic apps which are not loaded, for instance. | ||
foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_APPS} ${MISSION_CORE_MODULES} ${MISSION_PSPMODULES}) | ||
string(TOUPPER "${DEP}" DEPNAME) | ||
list(APPEND CFE_CONFIG_IDS MOD_SRCVER_${DEPNAME}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* @file | ||
* | ||
* Initialization for CFE configuration registry, external items | ||
* | ||
* These are generated from the build system, they are not directly set | ||
*/ | ||
|
||
#ifndef CFE_CONFIG_EXTERNAL_H | ||
#define CFE_CONFIG_EXTERNAL_H | ||
|
||
#include "cfe_config_api_typedefs.h" | ||
|
||
void CFE_Config_SetupPlatformConfigInfo(void); | ||
|
||
#endif /* CFE_CONFIG_EXTERNAL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* @file | ||
* | ||
* Function declarations for items implemented in init.c | ||
*/ | ||
|
||
#ifndef CFE_CONFIG_INIT_H | ||
#define CFE_CONFIG_INIT_H | ||
|
||
#include "cfe_config_api_typedefs.h" | ||
|
||
#include "cfe_config_ids.h" | ||
|
||
void CFE_Config_SetupBasicBuildInfo(void); | ||
int32 CFE_Config_Init(void); | ||
|
||
#endif /* CFE_CONFIG_INIT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* @file | ||
* | ||
* Function declarations for items implemented in lookup.c | ||
*/ | ||
|
||
#ifndef CFE_CONFIG_LOOKUP_H | ||
#define CFE_CONFIG_LOOKUP_H | ||
|
||
/* | ||
** Includes | ||
*/ | ||
#include "cfe_config_api_typedefs.h" | ||
#include "cfe_config_table.h" | ||
|
||
/** | ||
* @brief Gets the value record associated with a config ID | ||
*/ | ||
CFE_Config_ValueEntry_t *CFE_Config_LocateConfigRecordByID(CFE_ConfigId_t ConfigId); | ||
|
||
#endif /* CFE_CONFIG_LOOKUP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* @file | ||
* | ||
* Function declarations for items implemented in set.c | ||
*/ | ||
|
||
#ifndef CFE_CONFIG_SET_H | ||
#define CFE_CONFIG_SET_H | ||
|
||
/* | ||
** Includes | ||
*/ | ||
#include "cfe_config_api_typedefs.h" | ||
|
||
void CFE_Config_SetValue(CFE_ConfigId_t ConfigId, uint32 Value); | ||
void CFE_Config_SetObjPointer(CFE_ConfigId_t ConfigId, const void *Ptr); | ||
void CFE_Config_SetString(CFE_ConfigId_t ConfigId, const char *Ptr); | ||
void CFE_Config_SetArrayValue(CFE_ConfigId_t ConfigId, const CFE_Config_ArrayValue_t *ArrayPtr); | ||
|
||
#endif /* CFE_CONFIG_SET_H */ |
Oops, something went wrong.